Rename librarysync

This commit is contained in:
croneter 2018-10-24 17:19:36 +02:00
parent 4246711b1e
commit 842df1773f
3 changed files with 15 additions and 15 deletions

View file

@ -53,7 +53,7 @@ def reload_pkc():
for prop in WINDOW_PROPERTIES: for prop in WINDOW_PROPERTIES:
utils.window(prop, clear=True) utils.window(prop, clear=True)
# Clear video nodes properties # Clear video nodes properties
from .librarysync import videonodes from .library_sync import videonodes
videonodes.VideoNodes().clearProperties() videonodes.VideoNodes().clearProperties()
# Initializing # Initializing

View file

@ -9,7 +9,7 @@ from . import utils
from . import userclient from . import userclient
from . import initialsetup from . import initialsetup
from . import kodimonitor from . import kodimonitor
from . import librarysync from . import sync
from . import websocket_client from . import websocket_client
from . import plex_companion from . import plex_companion
from . import plex_functions as PF from . import plex_functions as PF
@ -34,13 +34,13 @@ class Service():
user = None user = None
ws = None ws = None
library = None sync = None
plexcompanion = None plexcompanion = None
user_running = False user_running = False
ws_running = False ws_running = False
alexa_running = False alexa_running = False
library_running = False sync_running = False
plexcompanion_running = False plexcompanion_running = False
kodimonitor_running = False kodimonitor_running = False
playback_starter_running = False playback_starter_running = False
@ -95,7 +95,7 @@ class Service():
self.user = userclient.UserClient() self.user = userclient.UserClient()
self.ws = websocket_client.PMS_Websocket() self.ws = websocket_client.PMS_Websocket()
self.alexa = websocket_client.Alexa_Websocket() self.alexa = websocket_client.Alexa_Websocket()
self.library = librarysync.LibrarySync() self.sync = sync.Sync()
self.plexcompanion = plex_companion.PlexCompanion() self.plexcompanion = plex_companion.PlexCompanion()
self.specialmonitor = kodimonitor.SpecialMonitor() self.specialmonitor = kodimonitor.SpecialMonitor()
self.playback_starter = playback_starter.PlaybackStarter() self.playback_starter = playback_starter.PlaybackStarter()
@ -149,9 +149,9 @@ class Service():
self.alexa_running = True self.alexa_running = True
self.alexa.start() self.alexa.start()
# Start the syncing thread # Start the syncing thread
if not self.library_running: if not self.sync_running:
self.library_running = True self.sync_running = True
self.library.start() self.sync.start()
# Start the Plex Companion thread # Start the Plex Companion thread
if not self.plexcompanion_running: if not self.plexcompanion_running:
self.plexcompanion_running = True self.plexcompanion_running = True

View file

@ -15,7 +15,7 @@ from . import itemtypes, plex_db, kodidb_functions as kodidb
from . import artwork, plex_functions as PF from . import artwork, plex_functions as PF
from . import variables as v, state from . import variables as v, state
LOG = getLogger('PLEX.librarysync') LOG = getLogger('PLEX.sync')
def set_library_scan_toggle(boolean=True): def set_library_scan_toggle(boolean=True):
@ -31,7 +31,7 @@ def set_library_scan_toggle(boolean=True):
utils.window('plex_dbScan', value="true") utils.window('plex_dbScan', value="true")
class LibrarySync(backgroundthread.KillableThread): class Sync(backgroundthread.KillableThread):
""" """
The one and only library sync thread. Spawn only 1! The one and only library sync thread. Spawn only 1!
""" """
@ -54,7 +54,7 @@ class LibrarySync(backgroundthread.KillableThread):
self.update_kodi_music_library = False self.update_kodi_music_library = False
# Lock used to wait on a full sync, e.g. on initial sync # Lock used to wait on a full sync, e.g. on initial sync
self.lock = backgroundthread.threading.Lock() self.lock = backgroundthread.threading.Lock()
super(LibrarySync, self).__init__() super(Sync, self).__init__()
def isCanceled(self): def isCanceled(self):
return xbmc.abortRequested or state.STOP_PKC return xbmc.abortRequested or state.STOP_PKC
@ -540,11 +540,11 @@ class LibrarySync(backgroundthread.KillableThread):
except: except:
state.DB_SCAN = False state.DB_SCAN = False
utils.window('plex_dbScan', clear=True) utils.window('plex_dbScan', clear=True)
utils.ERROR(txt='librarysync.py crashed', notify=True) utils.ERROR(txt='Sync.py crashed', notify=True)
raise raise
def _run_internal(self): def _run_internal(self):
LOG.info("---===### Starting LibrarySync ###===---") LOG.info("---===### Starting Sync ###===---")
install_sync_done = utils.settings('SyncInstallRunDone') == 'true' install_sync_done = utils.settings('SyncInstallRunDone') == 'true'
playlist_monitor = None playlist_monitor = None
@ -584,7 +584,7 @@ class LibrarySync(backgroundthread.KillableThread):
while self.isSuspended(): while self.isSuspended():
if self.isCanceled(): if self.isCanceled():
# Abort was requested while waiting. We should exit # Abort was requested while waiting. We should exit
LOG.info("###===--- LibrarySync Stopped ---===###") LOG.info("###===--- Sync Stopped ---===###")
return return
xbmc.sleep(1000) xbmc.sleep(1000)
@ -722,4 +722,4 @@ class LibrarySync(backgroundthread.KillableThread):
DU().stopSession() DU().stopSession()
except AttributeError: except AttributeError:
pass pass
LOG.info("###===--- LibrarySync Stopped ---===###") LOG.info("###===--- Sync Stopped ---===###")