Rename database to plex.db
This commit is contained in:
parent
ed281ad847
commit
266ad70605
7 changed files with 10 additions and 10 deletions
|
@ -21,7 +21,7 @@ class GetEmbyDB():
|
||||||
and the db gets closed
|
and the db gets closed
|
||||||
"""
|
"""
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
self.embyconn = kodiSQL('emby')
|
self.embyconn = kodiSQL('plex')
|
||||||
self.emby_db = Embydb_Functions(self.embyconn.cursor())
|
self.emby_db = Embydb_Functions(self.embyconn.cursor())
|
||||||
return self.emby_db
|
return self.emby_db
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ def deleteItem():
|
||||||
return
|
return
|
||||||
|
|
||||||
from utils import kodiSQL
|
from utils import kodiSQL
|
||||||
embyconn = kodiSQL('emby')
|
embyconn = kodiSQL('plex')
|
||||||
embycursor = embyconn.cursor()
|
embycursor = embyconn.cursor()
|
||||||
emby_db = embydb.Embydb_Functions(embycursor)
|
emby_db = embydb.Embydb_Functions(embycursor)
|
||||||
item = emby_db.getItem_byKodiId(dbid, itemtype)
|
item = emby_db.getItem_byKodiId(dbid, itemtype)
|
||||||
|
|
|
@ -45,7 +45,7 @@ class Items(object):
|
||||||
"""
|
"""
|
||||||
Open DB connections and cursors
|
Open DB connections and cursors
|
||||||
"""
|
"""
|
||||||
self.embyconn = kodiSQL('emby')
|
self.embyconn = kodiSQL('plex')
|
||||||
self.embycursor = self.embyconn.cursor()
|
self.embycursor = self.embyconn.cursor()
|
||||||
self.kodiconn = kodiSQL('video')
|
self.kodiconn = kodiSQL('video')
|
||||||
self.kodicursor = self.kodiconn.cursor()
|
self.kodicursor = self.kodiconn.cursor()
|
||||||
|
@ -1249,7 +1249,7 @@ class Music(Items):
|
||||||
OVERWRITE this method, because we need to open another DB.
|
OVERWRITE this method, because we need to open another DB.
|
||||||
Open DB connections and cursors
|
Open DB connections and cursors
|
||||||
"""
|
"""
|
||||||
self.embyconn = kodiSQL('emby')
|
self.embyconn = kodiSQL('plex')
|
||||||
self.embycursor = self.embyconn.cursor()
|
self.embycursor = self.embyconn.cursor()
|
||||||
# Here it is, not 'video' but 'music'
|
# Here it is, not 'video' but 'music'
|
||||||
self.kodiconn = kodiSQL('music')
|
self.kodiconn = kodiSQL('music')
|
||||||
|
|
|
@ -124,7 +124,7 @@ class KodiMonitor(xbmc.Monitor):
|
||||||
log.info("Item is invalid for emby deletion.")
|
log.info("Item is invalid for emby deletion.")
|
||||||
else:
|
else:
|
||||||
# Send the delete action to the server.
|
# Send the delete action to the server.
|
||||||
embyconn = utils.kodiSQL('emby')
|
embyconn = utils.kodiSQL('plex')
|
||||||
embycursor = embyconn.cursor()
|
embycursor = embyconn.cursor()
|
||||||
emby_db = embydb.Embydb_Functions(embycursor)
|
emby_db = embydb.Embydb_Functions(embycursor)
|
||||||
emby_dbitem = emby_db.getItem_byKodiId(kodiid, type)
|
emby_dbitem = emby_db.getItem_byKodiId(kodiid, type)
|
||||||
|
|
|
@ -532,7 +532,7 @@ class LibrarySync(Thread):
|
||||||
"""
|
"""
|
||||||
Run once during startup to verify that emby db exists.
|
Run once during startup to verify that emby db exists.
|
||||||
"""
|
"""
|
||||||
embyconn = kodiSQL('emby')
|
embyconn = kodiSQL('plex')
|
||||||
embycursor = embyconn.cursor()
|
embycursor = embyconn.cursor()
|
||||||
# Create the tables for the emby database
|
# Create the tables for the emby database
|
||||||
# emby, view, version
|
# emby, view, version
|
||||||
|
|
|
@ -101,7 +101,7 @@ class Read_EmbyServer():
|
||||||
viewId = view['Id']
|
viewId = view['Id']
|
||||||
|
|
||||||
# Compare to view table in emby database
|
# Compare to view table in emby database
|
||||||
emby = kodiSQL('emby')
|
emby = kodiSQL('plex')
|
||||||
cursor_emby = emby.cursor()
|
cursor_emby = emby.cursor()
|
||||||
query = ' '.join((
|
query = ' '.join((
|
||||||
|
|
||||||
|
|
|
@ -217,8 +217,8 @@ def getUnixTimestamp(secondsIntoTheFuture=None):
|
||||||
|
|
||||||
def kodiSQL(media_type="video"):
|
def kodiSQL(media_type="video"):
|
||||||
|
|
||||||
if media_type == "emby":
|
if media_type == "plex":
|
||||||
dbPath = tryDecode(xbmc.translatePath("special://database/emby.db"))
|
dbPath = tryDecode(xbmc.translatePath("special://database/plex.db"))
|
||||||
elif media_type == "music":
|
elif media_type == "music":
|
||||||
dbPath = getKodiMusicDBPath()
|
dbPath = getKodiMusicDBPath()
|
||||||
elif media_type == "texture":
|
elif media_type == "texture":
|
||||||
|
@ -363,7 +363,7 @@ def reset():
|
||||||
|
|
||||||
# Wipe the Plex database
|
# Wipe the Plex database
|
||||||
log.info("Resetting the Plex database.")
|
log.info("Resetting the Plex database.")
|
||||||
connection = kodiSQL('emby')
|
connection = kodiSQL('plex')
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
cursor.execute('SELECT tbl_name FROM sqlite_master WHERE type="table"')
|
cursor.execute('SELECT tbl_name FROM sqlite_master WHERE type="table"')
|
||||||
rows = cursor.fetchall()
|
rows = cursor.fetchall()
|
||||||
|
|
Loading…
Reference in a new issue