Transcoding: Fix Plex burning-in subtitles when it should not
This commit is contained in:
parent
41f26cdf3b
commit
727cf98771
2 changed files with 20 additions and 10 deletions
|
@ -425,7 +425,8 @@ def setup_transcoding_audio_subtitle_prefs(mediastreams, part_id):
|
||||||
action_type='PUT',
|
action_type='PUT',
|
||||||
parameters=args)
|
parameters=args)
|
||||||
|
|
||||||
select_subs_index = ''
|
# Zero telling the PMS to deactivate subs altogether
|
||||||
|
select_subs_index = 0
|
||||||
if sub_num == 1:
|
if sub_num == 1:
|
||||||
# Note: we DO need to tell the PMS that we DONT want any sub
|
# Note: we DO need to tell the PMS that we DONT want any sub
|
||||||
# Otherwise, the PMS might pick-up the last one
|
# Otherwise, the PMS might pick-up the last one
|
||||||
|
@ -444,15 +445,8 @@ def setup_transcoding_audio_subtitle_prefs(mediastreams, part_id):
|
||||||
LOG.info('User chose to not burn-in any subtitles')
|
LOG.info('User chose to not burn-in any subtitles')
|
||||||
else:
|
else:
|
||||||
LOG.info('User chose to burn-in subtitle %s: %s',
|
LOG.info('User chose to burn-in subtitle %s: %s',
|
||||||
select_subs_index,
|
select_subs_index, subtitle_streams[resp])
|
||||||
subtitle_streams[resp])
|
|
||||||
select_subs_index = subtitle_streams_list[resp - 1]
|
select_subs_index = subtitle_streams_list[resp - 1]
|
||||||
# Now prep the PMS for our choice
|
# Now prep the PMS for our choice
|
||||||
args = {
|
PF.change_subtitle(select_subs_index, part_id)
|
||||||
'subtitleStreamID': select_subs_index,
|
|
||||||
'allParts': 1
|
|
||||||
}
|
|
||||||
DU().downloadUrl('{server}/library/parts/%s' % part_id,
|
|
||||||
action_type='PUT',
|
|
||||||
parameters=args)
|
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -1116,3 +1116,19 @@ def playback_decision(path, media, part, playmethod, video=True, args=None):
|
||||||
return DU().downloadUrl(utils.extend_url(url, arguments),
|
return DU().downloadUrl(utils.extend_url(url, arguments),
|
||||||
headerOptions=v.STREAMING_HEADERS,
|
headerOptions=v.STREAMING_HEADERS,
|
||||||
reraise=True)
|
reraise=True)
|
||||||
|
|
||||||
|
|
||||||
|
def change_subtitle(plex_stream_id, part_id):
|
||||||
|
"""
|
||||||
|
Tell the PMS to display/burn-in the subtitle stream with id plex_stream_id
|
||||||
|
for the Part (PMS XML etree tag "Part") with unique id part_id.
|
||||||
|
- plex_stream_id = 0 will deactivate the subtitle
|
||||||
|
- We always do this for ALL parts of a video
|
||||||
|
"""
|
||||||
|
arguments = {
|
||||||
|
'subtitleStreamID': plex_stream_id,
|
||||||
|
'allParts': 1
|
||||||
|
}
|
||||||
|
url = '{server}/library/parts/%s' % part_id
|
||||||
|
return DU().downloadUrl(utils.extend_url(url, arguments),
|
||||||
|
action_type='PUT')
|
||||||
|
|
Loading…
Reference in a new issue