mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
commit
838160557a
3 changed files with 48 additions and 25 deletions
|
@ -223,7 +223,7 @@ msgid "Verify connection"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#30504"
|
msgctxt "#30504"
|
||||||
msgid "Use altername device name"
|
msgid "Use alternate device name"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgctxt "#30506"
|
msgctxt "#30506"
|
||||||
|
@ -945,3 +945,7 @@ msgstr ""
|
||||||
msgctxt "#33196"
|
msgctxt "#33196"
|
||||||
msgid "Advanced options"
|
msgid "Advanced options"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgctxt "#33197"
|
||||||
|
msgid "A sync is already running, please wait until it completes and try again."
|
||||||
|
msgstr ""
|
||||||
|
|
|
@ -27,10 +27,20 @@ LOG = logging.getLogger("EMBY."+__name__)
|
||||||
|
|
||||||
class FullSync(object):
|
class FullSync(object):
|
||||||
|
|
||||||
|
# Borg - multiple instances, shared state
|
||||||
|
_shared_state = {}
|
||||||
sync = None
|
sync = None
|
||||||
|
running = False
|
||||||
|
|
||||||
def __init__(self, library, library_id=None, update=False):
|
def __init__(self, library, library_id=None, update=False):
|
||||||
|
|
||||||
|
''' Map the syncing process and start the sync. Ensure only one sync is running.
|
||||||
|
'''
|
||||||
|
self.__dict__ = self._shared_state
|
||||||
|
|
||||||
|
if not self.running:
|
||||||
|
|
||||||
|
self.running = True
|
||||||
self.library = library
|
self.library = library
|
||||||
self.direct_path = settings('useDirectPaths') == "1"
|
self.direct_path = settings('useDirectPaths') == "1"
|
||||||
self.update_library = update
|
self.update_library = update
|
||||||
|
@ -60,6 +70,12 @@ class FullSync(object):
|
||||||
|
|
||||||
if not xmls.advanced_settings() and self.sync['Libraries']:
|
if not xmls.advanced_settings() and self.sync['Libraries']:
|
||||||
self.start()
|
self.start()
|
||||||
|
else:
|
||||||
|
self.running = False
|
||||||
|
else:
|
||||||
|
dialog("ok", heading="{emby}", line1=_(33197))
|
||||||
|
|
||||||
|
raise Exception("Sync is already running.")
|
||||||
|
|
||||||
def get_libraries(self, library_id=None):
|
def get_libraries(self, library_id=None):
|
||||||
|
|
||||||
|
@ -169,6 +185,8 @@ class FullSync(object):
|
||||||
xbmc.executebuiltin('InhibitIdleShutdown(false)')
|
xbmc.executebuiltin('InhibitIdleShutdown(false)')
|
||||||
set_screensaver(value=screensaver)
|
set_screensaver(value=screensaver)
|
||||||
|
|
||||||
|
self.running = False
|
||||||
|
|
||||||
raise
|
raise
|
||||||
|
|
||||||
elapsed = datetime.datetime.now() - start_time
|
elapsed = datetime.datetime.now() - start_time
|
||||||
|
@ -180,6 +198,7 @@ class FullSync(object):
|
||||||
dialog("notification", heading="{emby}", message="%s %s" % (_(33025), str(elapsed).split('.')[0]),
|
dialog("notification", heading="{emby}", message="%s %s" % (_(33025), str(elapsed).split('.')[0]),
|
||||||
icon="{emby}", sound=False)
|
icon="{emby}", sound=False)
|
||||||
LOG.info("Full sync completed in: %s", str(elapsed).split('.')[0])
|
LOG.info("Full sync completed in: %s", str(elapsed).split('.')[0])
|
||||||
|
self.running = False
|
||||||
|
|
||||||
def process_library(self, library_id):
|
def process_library(self, library_id):
|
||||||
|
|
||||||
|
|
|
@ -466,10 +466,10 @@ class PlayUtils(object):
|
||||||
|
|
||||||
for stream in source['MediaStreams']:
|
for stream in source['MediaStreams']:
|
||||||
|
|
||||||
if stream['Type'] == 'Subtitle' and stream['IsExternal'] and stream['IsTextSubtitleStream']:
|
if stream['Type'] == 'Subtitle' and stream['IsExternal']:
|
||||||
index = stream['Index']
|
index = stream['Index']
|
||||||
|
|
||||||
if 'DeliveryUrl' in stream and stream['DeliveryUrl'].lower().startswith('http'):
|
if 'DeliveryUrl' in stream and stream['DeliveryUrl'].lower().startswith('/videos'):
|
||||||
url = "%s/emby%s" % (self.info['ServerAddress'], stream['DeliveryUrl'])
|
url = "%s/emby%s" % (self.info['ServerAddress'], stream['DeliveryUrl'])
|
||||||
else:
|
else:
|
||||||
url = self.get_subtitles(source, stream, index)
|
url = self.get_subtitles(source, stream, index)
|
||||||
|
@ -625,7 +625,7 @@ class PlayUtils(object):
|
||||||
|
|
||||||
def get_subtitles(self, source, stream, index):
|
def get_subtitles(self, source, stream, index):
|
||||||
|
|
||||||
if 'DeliveryUrl' in stream and stream['DeliveryUrl'].lower().startswith('http'):
|
if stream['IsTextSubtitleStream'] and 'DeliveryUrl' in stream and stream['DeliveryUrl'].lower().startswith('/videos'):
|
||||||
url = "%s/emby%s" % (self.info['ServerAddress'], stream['DeliveryUrl'])
|
url = "%s/emby%s" % (self.info['ServerAddress'], stream['DeliveryUrl'])
|
||||||
else:
|
else:
|
||||||
url = ("%s/emby/Videos/%s/%s/Subtitles/%s/Stream.%s?api_key=%s" %
|
url = ("%s/emby/Videos/%s/%s/Subtitles/%s/Stream.%s?api_key=%s" %
|
||||||
|
|
Loading…
Reference in a new issue