mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
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:
parent
644bf51aff
commit
1855c4666b
1 changed files with 20 additions and 14 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue