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.ui.FontAwesome
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.embeddedSubtitleCount
import com.github.damontecres.wholphin.ui.playback.externalSubtitlesCount
@ -84,7 +85,7 @@ fun VideoStreamDetails(
} else {
null
}
val range = formatVideoRange(context, it.videoRange, it.videoRangeType)
val range = formatVideoRange(context, it.videoRange, it.videoRangeType, it.videoDoViTitle)
listOfNotNull(
resName.concatWithSpace(range),
it.codec?.uppercase(),
@ -255,6 +256,7 @@ fun formatVideoRange(
context: Context,
videoRange: VideoRange?,
type: VideoRangeType?,
doviTitle: String?,
): String? =
when (videoRange) {
VideoRange.UNKNOWN,
@ -264,6 +266,9 @@ fun formatVideoRange(
}
VideoRange.HDR -> {
if (doviTitle.isNotNullOrBlank()) {
context.getString(R.string.dolby_vision)
} else {
when (type) {
VideoRangeType.UNKNOWN,
VideoRangeType.SDR,
@ -284,6 +289,7 @@ fun formatVideoRange(
}
}
}
}
fun formatAudioCodec(
context: Context,