diff --git a/addon.xml b/addon.xml index d45444c4..dec5b602 100644 --- a/addon.xml +++ b/addon.xml @@ -89,6 +89,7 @@ - Improve PKC automatically connecting to local PMS - Ensure that our only video transcoding target is h264 - Fix adjusted subtitle size not working when burning in subtitles +- Fix regression: burn-in subtitles picking up the last user setting instead of the current one version 2.10.12: - versions 2.10.5-11 for everyone diff --git a/changelog.txt b/changelog.txt index b5ebc8e4..034fe82c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ version 2.11.0 (beta only): - Improve PKC automatically connecting to local PMS - Ensure that our only video transcoding target is h264 - Fix adjusted subtitle size not working when burning in subtitles +- Fix regression: burn-in subtitles picking up the last user setting instead of the current one version 2.10.12: - versions 2.10.5-11 for everyone diff --git a/resources/lib/playback.py b/resources/lib/playback.py index de5220d0..bb46b21d 100644 --- a/resources/lib/playback.py +++ b/resources/lib/playback.py @@ -451,6 +451,11 @@ def _conclude_playback(playqueue, pos): LOG.debug('Concluding playback for playqueue position %s', pos) item = playqueue.items[pos] api = API(item.xml) + if api.mediastream_number() is None: + # E.g. user could choose between several media streams and cancelled + LOG.debug('Did not get a mediastream_number') + _ensure_resolve() + return api.part = item.part or 0 listitem = api.listitem(listitem=transfer.PKCListItem, resume=False) set_playurl(api, item) @@ -464,6 +469,9 @@ def _conclude_playback(playqueue, pos): elif item.playmethod in (v.PLAYBACK_METHOD_DIRECT_STREAM, v.PLAYBACK_METHOD_TRANSCODE): audio_subtitle_prefs(api, listitem) + # Need to hit the PMS api again in order to get the selected + # burn-in subtitles set-up correctly + set_playurl(api, item) transfer.send(listitem) LOG.debug('Done concluding playback') diff --git a/resources/lib/playback_decision.py b/resources/lib/playback_decision.py index 4f0a855f..4035ad6f 100644 --- a/resources/lib/playback_decision.py +++ b/resources/lib/playback_decision.py @@ -19,9 +19,6 @@ CONVERSION_OK = 1001 # PMS can either direct stream or transcode def set_playurl(api, item): - if api.mediastream_number() is None: - # E.g. user could choose between several media streams and cancelled - return item.playmethod = int(utils.settings('playType')) LOG.info('User chose playback method %s in PKC settings', v.EXPLICIT_PLAYBACK_METHOD[item.playmethod]) @@ -420,19 +417,21 @@ def audio_subtitle_prefs(api, listitem): # Enable Kodi to switch autonomously to downloadable subtitles if download_subs: listitem.setSubtitles(download_subs) + select_subs_index = '' if sub_num == 1: + # Note: we DO need to tell the PMS that we DONT want any sub + # Otherwise, the PMS might pick-up the last one LOG.debug('No subtitles to burn-in') - return - - resp = utils.dialog('select', utils.lang(33014), subtitle_streams) - if resp < 1: - # User did not select a subtitle or backed out of the dialog - LOG.debug('User chose to not burn-in any subtitles') - return - select_subs_index = subtitle_streams_list[resp - 1] - LOG.debug('User chose to burn-in subtitle %s: %s', - select_subs_index, - subtitle_streams[resp].decode('utf-8')) + else: + resp = utils.dialog('select', utils.lang(33014), subtitle_streams) + if resp < 1: + # User did not select a subtitle or backed out of the dialog + LOG.debug('User chose to not burn-in any subtitles') + else: + LOG.debug('User chose to burn-in subtitle %s: %s', + select_subs_index, + subtitle_streams[resp].decode('utf-8')) + select_subs_index = subtitle_streams_list[resp - 1] # Now prep the PMS for our choice args = { 'subtitleStreamID': select_subs_index,