Merge pull request #1584 from croneter/py3-fix-playback
Fix PMS setting `List of IP addresses and networks that are allowed without auth` causing Kodi to take forever to start playback
This commit is contained in:
commit
a2a417f949
1 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
import re
|
||||||
|
|
||||||
from ..utils import cast
|
from ..utils import cast
|
||||||
from ..downloadutils import DownloadUtils as DU
|
from ..downloadutils import DownloadUtils as DU
|
||||||
|
@ -10,6 +11,9 @@ from .. import plex_functions as PF
|
||||||
LOG = getLogger('PLEX.api')
|
LOG = getLogger('PLEX.api')
|
||||||
|
|
||||||
|
|
||||||
|
REGEX_VIDEO_FILENAME = re.compile(r'''\/file\.[a-zA-Z0-9]{1,5}$''')
|
||||||
|
|
||||||
|
|
||||||
class Media(object):
|
class Media(object):
|
||||||
def optimized_for_streaming(self):
|
def optimized_for_streaming(self):
|
||||||
"""
|
"""
|
||||||
|
@ -286,6 +290,12 @@ class Media(object):
|
||||||
headers = clientinfo.getXArgsDeviceInfo()
|
headers = clientinfo.getXArgsDeviceInfo()
|
||||||
if action == v.PLAYBACK_METHOD_DIRECT_PLAY:
|
if action == v.PLAYBACK_METHOD_DIRECT_PLAY:
|
||||||
path = self.xml[self.mediastream][self.part].get('key')
|
path = self.xml[self.mediastream][self.part].get('key')
|
||||||
|
# Kodi 19 will try to look for subtitles in the directory containing the file.
|
||||||
|
# '/' and '/file.*'' both point to the file, and Kodi will happily try to read
|
||||||
|
# the whole file without recognizing it isn't a directory.
|
||||||
|
# To get around that, we omit the filename here since it is unnecessary.
|
||||||
|
# We do this for library videos only, not for e.g. trailers (does not work)
|
||||||
|
path = REGEX_VIDEO_FILENAME.sub('/', path, count=1)
|
||||||
# e.g. Trailers already feature an '?'!
|
# e.g. Trailers already feature an '?'!
|
||||||
return utils.extend_url(app.CONN.server + path, headers)
|
return utils.extend_url(app.CONN.server + path, headers)
|
||||||
# Direct Streaming and Transcoding
|
# Direct Streaming and Transcoding
|
||||||
|
|
Loading…
Reference in a new issue