Add emby.connected prop

This commit is contained in:
angelblue05 2018-06-09 00:20:15 -05:00
parent d037092701
commit f93fd75361
2 changed files with 22 additions and 1 deletions

View file

@ -404,6 +404,10 @@ class LibrarySync(threading.Thread):
movies.count = 0 movies.count = 0
for all_movies in mb.get_items(view['id'], "Movie"): for all_movies in mb.get_items(view['id'], "Movie"):
if should_stop():
return False
movies.add_all("Movie", all_movies, view) movies.add_all("Movie", all_movies, view)
log.debug("Movies finished.") log.debug("Movies finished.")
@ -418,6 +422,10 @@ class LibrarySync(threading.Thread):
movies.count = 0 movies.count = 0
for boxsets in mb.get_items(None, "BoxSet"): for boxsets in mb.get_items(None, "BoxSet"):
if should_stop():
return False
movies.add_all("BoxSet", boxsets) movies.add_all("BoxSet", boxsets)
log.debug("Boxsets finished.") log.debug("Boxsets finished.")
@ -446,6 +454,10 @@ class LibrarySync(threading.Thread):
# Initial or repair sync # Initial or repair sync
mvideos.count = 0 mvideos.count = 0
for all_mvideos in mb.get_items(view['id'], "MusicVideo"): for all_mvideos in mb.get_items(view['id'], "MusicVideo"):
if should_stop():
return False
mvideos.add_all("MusicVideo", all_mvideos, view) mvideos.add_all("MusicVideo", all_mvideos, view)
else: else:
@ -473,6 +485,10 @@ class LibrarySync(threading.Thread):
tvshows.count = 0 tvshows.count = 0
for all_tvshows in mb.get_items(view['id'], "Series"): for all_tvshows in mb.get_items(view['id'], "Series"):
if should_stop():
return False
tvshows.add_all("Series", all_tvshows, view) tvshows.add_all("Series", all_tvshows, view)
else: else:
@ -497,6 +513,10 @@ class LibrarySync(threading.Thread):
music.count = 0 music.count = 0
for all_artists in mb.get_artists(view['id']): for all_artists in mb.get_artists(view['id']):
if should_stop():
return False
music.add_all("MusicArtist", all_artists) music.add_all("MusicArtist", all_artists)
log.debug("Finished syncing music") log.debug("Finished syncing music")
@ -750,6 +770,7 @@ class LibrarySync(threading.Thread):
# Only try the initial sync once per kodi session regardless # Only try the initial sync once per kodi session regardless
# This will prevent an infinite loop in case something goes wrong. # This will prevent an infinite loop in case something goes wrong.
startupComplete = True startupComplete = True
window('emby.connected', value="true")
# Process updates # Process updates
if self.incremental_count > 5: if self.incremental_count > 5:

View file

@ -76,7 +76,7 @@ class Service(object):
"emby_syncRunning", "emby_dbCheck", "emby_kodiScan", "emby_syncRunning", "emby_dbCheck", "emby_kodiScan",
"emby_shouldStop", "emby_currUser", "emby_dbScan", "emby_sessionId", "emby_shouldStop", "emby_currUser", "emby_dbScan", "emby_sessionId",
"emby_initialScan", "emby_customplaylist", "emby_playbackProps", "emby_initialScan", "emby_customplaylist", "emby_playbackProps",
"emby.external_check", "emby.external", "emby.resume" "emby.external_check", "emby.external", "emby.resume", "emby.connected"
] ]
for prop in properties: for prop in properties:
window(prop, clear=True) window(prop, clear=True)