Always show video as Dolby Vision if it has DoVi title (#502)

## Description
Always show the "Dolby Vision" label instead of just HDR if the video
has a Dolby Vision title. This matches the behavior of the official app.

### Related issues
Fixes #491
This commit is contained in:
Ray 2025-12-18 14:28:22 -05:00 committed by GitHub
parent 644bf51aff
commit 1855c4666b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,6 +31,7 @@ import com.github.damontecres.wholphin.data.ChosenStreams
import com.github.damontecres.wholphin.preferences.AppThemeColors import com.github.damontecres.wholphin.preferences.AppThemeColors
import com.github.damontecres.wholphin.ui.FontAwesome import com.github.damontecres.wholphin.ui.FontAwesome
import com.github.damontecres.wholphin.ui.PreviewTvSpec import com.github.damontecres.wholphin.ui.PreviewTvSpec
import com.github.damontecres.wholphin.ui.isNotNullOrBlank
import com.github.damontecres.wholphin.ui.playback.audioStreamCount import com.github.damontecres.wholphin.ui.playback.audioStreamCount
import com.github.damontecres.wholphin.ui.playback.embeddedSubtitleCount import com.github.damontecres.wholphin.ui.playback.embeddedSubtitleCount
import com.github.damontecres.wholphin.ui.playback.externalSubtitlesCount import com.github.damontecres.wholphin.ui.playback.externalSubtitlesCount
@ -84,7 +85,7 @@ fun VideoStreamDetails(
} else { } else {
null null
} }
val range = formatVideoRange(context, it.videoRange, it.videoRangeType) val range = formatVideoRange(context, it.videoRange, it.videoRangeType, it.videoDoViTitle)
listOfNotNull( listOfNotNull(
resName.concatWithSpace(range), resName.concatWithSpace(range),
it.codec?.uppercase(), it.codec?.uppercase(),
@ -255,6 +256,7 @@ fun formatVideoRange(
context: Context, context: Context,
videoRange: VideoRange?, videoRange: VideoRange?,
type: VideoRangeType?, type: VideoRangeType?,
doviTitle: String?,
): String? = ): String? =
when (videoRange) { when (videoRange) {
VideoRange.UNKNOWN, VideoRange.UNKNOWN,
@ -264,23 +266,27 @@ fun formatVideoRange(
} }
VideoRange.HDR -> { VideoRange.HDR -> {
when (type) { if (doviTitle.isNotNullOrBlank()) {
VideoRangeType.UNKNOWN, context.getString(R.string.dolby_vision)
VideoRangeType.SDR, } else {
null, when (type) {
-> null VideoRangeType.UNKNOWN,
VideoRangeType.SDR,
null,
-> null
VideoRangeType.HDR10 -> "HDR10" VideoRangeType.HDR10 -> "HDR10"
VideoRangeType.HDR10_PLUS -> "HDR10+" VideoRangeType.HDR10_PLUS -> "HDR10+"
VideoRangeType.HLG -> "HLG" VideoRangeType.HLG -> "HLG"
VideoRangeType.DOVI, VideoRangeType.DOVI,
VideoRangeType.DOVI_WITH_HDR10, VideoRangeType.DOVI_WITH_HDR10,
VideoRangeType.DOVI_WITH_HLG, VideoRangeType.DOVI_WITH_HLG,
VideoRangeType.DOVI_WITH_SDR, VideoRangeType.DOVI_WITH_SDR,
-> context.getString(R.string.dolby_vision) -> context.getString(R.string.dolby_vision)
}
} }
} }
} }