From 266ad70605c8620271a1c1443d789f10bc583860 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 4 Jan 2017 20:09:09 +0100 Subject: [PATCH] Rename database to plex.db --- resources/lib/embydb_functions.py | 2 +- resources/lib/entrypoint.py | 2 +- resources/lib/itemtypes.py | 4 ++-- resources/lib/kodimonitor.py | 2 +- resources/lib/librarysync.py | 2 +- resources/lib/read_embyserver.py | 2 +- resources/lib/utils.py | 6 +++--- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/lib/embydb_functions.py b/resources/lib/embydb_functions.py index 3f173e70..d502a4b7 100644 --- a/resources/lib/embydb_functions.py +++ b/resources/lib/embydb_functions.py @@ -21,7 +21,7 @@ class GetEmbyDB(): and the db gets closed """ def __enter__(self): - self.embyconn = kodiSQL('emby') + self.embyconn = kodiSQL('plex') self.emby_db = Embydb_Functions(self.embyconn.cursor()) return self.emby_db diff --git a/resources/lib/entrypoint.py b/resources/lib/entrypoint.py index c6c4ec93..84fe180d 100644 --- a/resources/lib/entrypoint.py +++ b/resources/lib/entrypoint.py @@ -264,7 +264,7 @@ def deleteItem(): return from utils import kodiSQL - embyconn = kodiSQL('emby') + embyconn = kodiSQL('plex') embycursor = embyconn.cursor() emby_db = embydb.Embydb_Functions(embycursor) item = emby_db.getItem_byKodiId(dbid, itemtype) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 04b83d0f..e91ea674 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -45,7 +45,7 @@ class Items(object): """ Open DB connections and cursors """ - self.embyconn = kodiSQL('emby') + self.embyconn = kodiSQL('plex') self.embycursor = self.embyconn.cursor() self.kodiconn = kodiSQL('video') self.kodicursor = self.kodiconn.cursor() @@ -1249,7 +1249,7 @@ class Music(Items): OVERWRITE this method, because we need to open another DB. Open DB connections and cursors """ - self.embyconn = kodiSQL('emby') + self.embyconn = kodiSQL('plex') self.embycursor = self.embyconn.cursor() # Here it is, not 'video' but 'music' self.kodiconn = kodiSQL('music') diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 64059295..066613da 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -124,7 +124,7 @@ class KodiMonitor(xbmc.Monitor): log.info("Item is invalid for emby deletion.") else: # Send the delete action to the server. - embyconn = utils.kodiSQL('emby') + embyconn = utils.kodiSQL('plex') embycursor = embyconn.cursor() emby_db = embydb.Embydb_Functions(embycursor) emby_dbitem = emby_db.getItem_byKodiId(kodiid, type) diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 9b6f8cc4..749990cd 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -532,7 +532,7 @@ class LibrarySync(Thread): """ Run once during startup to verify that emby db exists. """ - embyconn = kodiSQL('emby') + embyconn = kodiSQL('plex') embycursor = embyconn.cursor() # Create the tables for the emby database # emby, view, version diff --git a/resources/lib/read_embyserver.py b/resources/lib/read_embyserver.py index 3388e847..badedca6 100644 --- a/resources/lib/read_embyserver.py +++ b/resources/lib/read_embyserver.py @@ -101,7 +101,7 @@ class Read_EmbyServer(): viewId = view['Id'] # Compare to view table in emby database - emby = kodiSQL('emby') + emby = kodiSQL('plex') cursor_emby = emby.cursor() query = ' '.join(( diff --git a/resources/lib/utils.py b/resources/lib/utils.py index eeabdb62..c55af70e 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -217,8 +217,8 @@ def getUnixTimestamp(secondsIntoTheFuture=None): def kodiSQL(media_type="video"): - if media_type == "emby": - dbPath = tryDecode(xbmc.translatePath("special://database/emby.db")) + if media_type == "plex": + dbPath = tryDecode(xbmc.translatePath("special://database/plex.db")) elif media_type == "music": dbPath = getKodiMusicDBPath() elif media_type == "texture": @@ -363,7 +363,7 @@ def reset(): # Wipe the Plex database log.info("Resetting the Plex database.") - connection = kodiSQL('emby') + connection = kodiSQL('plex') cursor = connection.cursor() cursor.execute('SELECT tbl_name FROM sqlite_master WHERE type="table"') rows = cursor.fetchall()