mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
playutils: Show embedded subs in sub track selection dialog
* show embedded subtitles in subtitle track selection dialog when transcoding if server subtitle extraction is enabled
This commit is contained in:
parent
fd93723968
commit
65b1704365
1 changed files with 8 additions and 6 deletions
|
@ -598,6 +598,7 @@ class PlayUtils(object):
|
||||||
subs_streams = collections.OrderedDict()
|
subs_streams = collections.OrderedDict()
|
||||||
streams = source['MediaStreams']
|
streams = source['MediaStreams']
|
||||||
|
|
||||||
|
server_settings = TheVoid('GetTranscodeOptions', {'ServerId': self.info['ServerId']}).get()
|
||||||
allow_burned_subs = settings('allowBurnedSubs.bool')
|
allow_burned_subs = settings('allowBurnedSubs.bool')
|
||||||
|
|
||||||
for stream in streams:
|
for stream in streams:
|
||||||
|
@ -619,9 +620,13 @@ class PlayUtils(object):
|
||||||
audio_streams[track] = index
|
audio_streams[track] = index
|
||||||
|
|
||||||
elif stream_type == 'Subtitle':
|
elif stream_type == 'Subtitle':
|
||||||
downloadable = stream['IsTextSubtitleStream'] and stream['IsExternal'] and stream['SupportsExternalStream']
|
if stream['IsExternal']:
|
||||||
if not downloadable and not allow_burned_subs:
|
if not stream['SupportsExternalStream'] and not allow_burned_subs:
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
avail_for_extraction = stream['SupportsExternalStream'] and server_settings['EnableSubtitleExtraction']
|
||||||
|
if not avail_for_extraction and not allow_burned_subs:
|
||||||
|
continue
|
||||||
|
|
||||||
codec = self.get_commercial_codec_name(stream['Codec'], None)
|
codec = self.get_commercial_codec_name(stream['Codec'], None)
|
||||||
|
|
||||||
|
@ -660,7 +665,6 @@ class PlayUtils(object):
|
||||||
if subtitle:
|
if subtitle:
|
||||||
|
|
||||||
index = subtitle
|
index = subtitle
|
||||||
server_settings = TheVoid('GetTranscodeOptions', {'ServerId': self.info['ServerId']}).get()
|
|
||||||
stream = streams[index]
|
stream = streams[index]
|
||||||
|
|
||||||
if server_settings['EnableSubtitleExtraction'] and stream['SupportsExternalStream']:
|
if server_settings['EnableSubtitleExtraction'] and stream['SupportsExternalStream']:
|
||||||
|
@ -679,8 +683,6 @@ class PlayUtils(object):
|
||||||
index = subs_streams[selection[resp]] if resp > -1 else source.get('DefaultSubtitleStreamIndex')
|
index = subs_streams[selection[resp]] if resp > -1 else source.get('DefaultSubtitleStreamIndex')
|
||||||
|
|
||||||
if index is not None:
|
if index is not None:
|
||||||
|
|
||||||
server_settings = TheVoid('GetTranscodeOptions', {'ServerId': self.info['ServerId']}).get()
|
|
||||||
stream = streams[index]
|
stream = streams[index]
|
||||||
|
|
||||||
if server_settings['EnableSubtitleExtraction'] and stream['SupportsExternalStream']:
|
if server_settings['EnableSubtitleExtraction'] and stream['SupportsExternalStream']:
|
||||||
|
|
Loading…
Reference in a new issue