Skip to content

Commit

Permalink
fix(notification): Allow overriding duration value
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvz committed Oct 10, 2023
1 parent 77cbccd commit 1d1dd0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface AudioItem {
var title: String?
var albumTitle: String?
val artwork: String?
val duration: Long
val duration: Long?
val options: AudioItemOptions?
}

Expand Down Expand Up @@ -53,7 +53,7 @@ data class DefaultAudioItem(
override var title: String? = null,
override var albumTitle: String? = null,
override var artwork: String? = null,
override val duration: Long = -1,
override val duration: Long? = null,
override val options: AudioItemOptions? = null,
) : AudioItem

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ class NotificationManager internal constructor(
else player.getMediaItemAt(index)

return if (player.isCurrentMediaItemDynamic || player.duration == C.TIME_UNSET) {
mediaItem?.getAudioItemHolder()?.audioItem?.duration ?: -1
overrideAudioItem?.duration ?: mediaItem?.getAudioItemHolder()?.audioItem?.duration ?: -1
} else {
player.duration
overrideAudioItem?.duration ?: player.duration
}
}

Expand Down

0 comments on commit 1d1dd0e

Please sign in to comment.