diff --git a/resources/lib/kodidb_functions.py b/resources/lib/kodidb_functions.py index 84abc884..840774b0 100644 --- a/resources/lib/kodidb_functions.py +++ b/resources/lib/kodidb_functions.py @@ -44,6 +44,20 @@ class Kodidb_Functions(): self.cursor = cursor self.artwork = artwork.Artwork() + def check_path(self): + query = ' '.join(( + "SELECT idPath", + "FROM path", + "WHERE strPath = ?" + )) + self.cursor.execute(query, ('smb://TOMSNAS/PlexMovies/',)) + try: + pathid = self.cursor.fetchone()[0] + except TypeError: + pathid = None + + return pathid + def setup_path_table(self): """ Use with Kodi video DB diff --git a/resources/lib/playqueue.py b/resources/lib/playqueue.py index 84cee9a0..6eea9de8 100644 --- a/resources/lib/playqueue.py +++ b/resources/lib/playqueue.py @@ -15,6 +15,7 @@ from plexbmchelper.subscribers import LOCK from playback import play_xml import json_rpc as js import variables as v +import kodidb_functions as kodidb ############################################################################### LOG = getLogger("PLEX." + __name__) @@ -218,6 +219,7 @@ class PlayqueueMonitor(Thread): stopped = self.stopped suspended = self.suspended LOG.info("----===## Starting PlayqueueMonitor ##===----") + tested = False while not stopped(): while suspended(): if stopped(): @@ -230,5 +232,10 @@ class PlayqueueMonitor(Thread): # compare old and new playqueue self._compare_playqueues(playqueue, kodi_pl) playqueue.old_kodi_pl = list(kodi_pl) - sleep(200) + with kodidb.GetKodiDB('video') as kodi_db: + # Setup the paths for addon-paths (even when using direct paths) + if kodi_db.check_path() and not tested: + tested = True + LOG.error('NOW!') + sleep(50) LOG.info("----===## PlayqueueMonitor stopped ##===----")