mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Merge pull request #71 from TrueTechy/master
Change companion detection to endpoint check #23
This commit is contained in:
commit
568448b80b
2 changed files with 12 additions and 7 deletions
|
@ -238,6 +238,13 @@ class API(object):
|
||||||
def get_plugins(self):
|
def get_plugins(self):
|
||||||
return self._get("Plugins")
|
return self._get("Plugins")
|
||||||
|
|
||||||
|
def check_companion_installed(self):
|
||||||
|
try:
|
||||||
|
self._get("/Jellyfin.Plugin.KodiSyncQueue/GetServerDateTime")
|
||||||
|
return True
|
||||||
|
except Exception:
|
||||||
|
return False
|
||||||
|
|
||||||
def get_seasons(self, show_id):
|
def get_seasons(self, show_id):
|
||||||
return self.shows("/%s/Seasons" % show_id, params={
|
return self.shows("/%s/Seasons" % show_id, params={
|
||||||
'UserId': "{UserId}",
|
'UserId': "{UserId}",
|
||||||
|
|
|
@ -348,17 +348,15 @@ class Library(threading.Thread):
|
||||||
if settings('SyncInstallRunDone.bool'):
|
if settings('SyncInstallRunDone.bool'):
|
||||||
if settings('kodiCompanion.bool'):
|
if settings('kodiCompanion.bool'):
|
||||||
|
|
||||||
for plugin in self.server.jellyfin.get_plugins():
|
if self.server.jellyfin.check_companion_installed():
|
||||||
if plugin['Name'] in ("Jellyfin.Kodi Sync Queue", "Kodi companion", "Kodi Sync Queue"):
|
|
||||||
|
|
||||||
if not self.fast_sync():
|
if not self.fast_sync():
|
||||||
dialog("ok", heading="{jellyfin}", line1=_(33128))
|
dialog("ok", heading="{jellyfin}", line1=_(33128))
|
||||||
|
|
||||||
raise Exception("Failed to retrieve latest updates")
|
raise Exception("Failed to retrieve latest updates")
|
||||||
|
|
||||||
LOG.info("--<[ retrieve changes ]")
|
LOG.info("--<[ retrieve changes ]")
|
||||||
|
|
||||||
break
|
|
||||||
else:
|
else:
|
||||||
raise LibraryException('CompanionMissing')
|
raise LibraryException('CompanionMissing')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue