Monitor for DB file path change
This commit is contained in:
parent
0173129ffc
commit
aac22c3369
2 changed files with 22 additions and 1 deletions
|
@ -44,6 +44,20 @@ class Kodidb_Functions():
|
||||||
self.cursor = cursor
|
self.cursor = cursor
|
||||||
self.artwork = artwork.Artwork()
|
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):
|
def setup_path_table(self):
|
||||||
"""
|
"""
|
||||||
Use with Kodi video DB
|
Use with Kodi video DB
|
||||||
|
|
|
@ -15,6 +15,7 @@ from plexbmchelper.subscribers import LOCK
|
||||||
from playback import play_xml
|
from playback import play_xml
|
||||||
import json_rpc as js
|
import json_rpc as js
|
||||||
import variables as v
|
import variables as v
|
||||||
|
import kodidb_functions as kodidb
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
LOG = getLogger("PLEX." + __name__)
|
LOG = getLogger("PLEX." + __name__)
|
||||||
|
@ -218,6 +219,7 @@ class PlayqueueMonitor(Thread):
|
||||||
stopped = self.stopped
|
stopped = self.stopped
|
||||||
suspended = self.suspended
|
suspended = self.suspended
|
||||||
LOG.info("----===## Starting PlayqueueMonitor ##===----")
|
LOG.info("----===## Starting PlayqueueMonitor ##===----")
|
||||||
|
tested = False
|
||||||
while not stopped():
|
while not stopped():
|
||||||
while suspended():
|
while suspended():
|
||||||
if stopped():
|
if stopped():
|
||||||
|
@ -230,5 +232,10 @@ class PlayqueueMonitor(Thread):
|
||||||
# compare old and new playqueue
|
# compare old and new playqueue
|
||||||
self._compare_playqueues(playqueue, kodi_pl)
|
self._compare_playqueues(playqueue, kodi_pl)
|
||||||
playqueue.old_kodi_pl = list(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 ##===----")
|
LOG.info("----===## PlayqueueMonitor stopped ##===----")
|
||||||
|
|
Loading…
Reference in a new issue