no more bad subs

This commit is contained in:
sevenrats 2022-12-13 20:47:26 -05:00
parent a714eae7cd
commit 5961f16087
4 changed files with 33 additions and 3 deletions

View File

@ -820,5 +820,15 @@
<translation>Unable to find any albums or songs belonging to this artist</translation>
<extracomment>Popup message when we find no audio data for an artist</extracomment>
</message>
<message>
<source>Hide Unsupported Subs</source>
<translation>Hide Unsupported Subs</translation>
<extracomment>Name of a setting - should we hide subtitles that might transcode</extracomment>
</message>
<message>
<source>Only display text subtitles to minimize transcoding.</source>
<translation>Only display text subtitles to minimize transcoding.</translation>
<extracomment>Description of a setting - should we hide subtitles that might transcode</extracomment>
</message>
</context>
</TS>

View File

@ -23,6 +23,13 @@
"settingName": "playback.cinemamode",
"type": "bool",
"default": "false"
},
{
"title": "Hide Unsupported Subs",
"description": "Only display text subtitles to minimize transcoding.",
"settingName": "playback.subs.onlytext",
"type": "bool",
"default": "false"
}
]
},

View File

@ -200,7 +200,17 @@ sub AddVideoContent(video, mediaSourceId, audio_stream_idx = 1, subtitle_idx = -
end if
subtitles = sortSubtitles(meta.id, m.playbackInfo.MediaSources[0].MediaStreams)
video.Subtitles = subtitles["all"]
if get_user_setting("playback.subs.onlytext") = "true"
safesubs = []
for each subtitle in subtitles["all"]
if subtitle["IsTextSubtitleStream"]
safesubs.push(subtitle)
end if
end for
video.Subtitles = safesubs
else
video.Subtitles = subtitles["all"]
end if
if meta.live
video.transcodeParams = {

View File

@ -27,10 +27,13 @@ function defaultSubtitleTrackFromVid(video_id) as integer
if default_text_subs <> -1
return default_text_subs
else
return defaultSubtitleTrack(subtitles["all"]) ' if no appropriate text subs exist, allow non-text
if get_user_setting("playback.subs.onlytext") = "false"
return defaultSubtitleTrack(subtitles["all"]) ' if no appropriate text subs exist, allow non-text
else
return -1
end if
end if
end if
' No valid mediaSources (i.e. LiveTV)
return -1
end function