playutils: Honor EnableSubtitleExtraction server option

* fix bug where subtitle streams that don't support external streaming
  would show up in video player OSD selection as external when transcoding
  (e.g. embedded PGSSUB)
* fix bug where EnableSubtitleExtraction server setting wasn't taken
  into consideration when transcoding
This commit is contained in:
Michal Chvíla 2020-10-28 11:43:47 +01:00
parent d260f8e90b
commit fd93723968
1 changed files with 6 additions and 1 deletions

View File

@ -509,8 +509,13 @@ class PlayUtils(object):
mapping = {}
kodi = 0
server_settings = TheVoid('GetTranscodeOptions', {'ServerId': self.info['ServerId']}).get()
for stream in source['MediaStreams']:
if stream['Type'] == 'Subtitle' and stream['DeliveryMethod'] == 'External':
if stream['SupportsExternalStream'] and stream['Type'] == 'Subtitle' and stream['DeliveryMethod'] == 'External':
if not stream['IsExternal'] and not server_settings['EnableSubtitleExtraction']:
continue
index = stream['Index']
url = self.get_subtitles(source, stream, index)