Merge pull request #1010 from croneter/fix-subtitles

Fix external subtitles not being available
This commit is contained in:
croneter 2019-10-05 16:58:18 +02:00 committed by GitHub
commit 2506dbeb43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -435,7 +435,7 @@ def _playback_cleanup(ended=False):
# Remember the last played item later
app.PLAYSTATE.old_player_states[playerid] = copy.deepcopy(status)
# Stop transcoding
if status['playmethod'] == 'Transcode':
if status['playmethod'] == v.PLAYBACK_METHOD_TRANSCODE:
LOG.debug('Tell the PMS to stop transcoding')
DU().downloadUrl(
'{server}/video/:/transcode/universal/stop',

View file

@ -19,7 +19,7 @@ from . import playlist_func as PL
from . import playqueue as PQ
from . import json_rpc as js
from . import transfer
from .playback_decision import set_playurl
from .playback_decision import set_playurl, audio_subtitle_prefs
from . import variables as v
from . import app
@ -473,10 +473,11 @@ def _conclude_playback(playqueue, pos):
_ensure_resolve()
return
listitem.setPath(item.file.encode('utf-8'))
if item.playmethod == 'DirectStream':
if item.playmethod == v.PLAYBACK_METHOD_DIRECT_PLAY:
listitem.setSubtitles(api.cache_external_subs())
elif item.playmethod == 'Transcode':
playutils.audio_subtitle_prefs(listitem)
elif item.playmethod in (v.PLAYBACK_METHOD_DIRECT_STREAM,
v.PLAYBACK_METHOD_TRANSCODE):
audio_subtitle_prefs(api, listitem)
_set_resume(listitem, item, api)
transfer.send(listitem)
LOG.info('Done concluding playback')
@ -518,7 +519,7 @@ def process_indirect(key, offset, resolve=True):
playqueue.clear()
item = PL.playlist_item_from_xml(xml[0])
item.offset = offset
item.playmethod = 'DirectStream'
item.playmethod = v.PLAYBACK_METHOD_DIRECT_PLAY
# Need to get yet another xml to get the final playback url
try: