Database warning
Warn the user visually of the database not found error.
This commit is contained in:
parent
6a9eddd413
commit
d0bf205331
2 changed files with 34 additions and 40 deletions
|
@ -1078,6 +1078,15 @@ class LibrarySync(threading.Thread):
|
||||||
|
|
||||||
# Library sync
|
# Library sync
|
||||||
if not startupComplete:
|
if not startupComplete:
|
||||||
|
|
||||||
|
# Verify the database for videos
|
||||||
|
videodb = utils.getKodiVideoDBPath()
|
||||||
|
if not xbmcvfs.exists(videodb):
|
||||||
|
# Database does not exists.
|
||||||
|
self.logMsg("The current Kodi version is incompatible with the Emby for Kodi add-on. Please visit here, to see currently supported Kodi versions: https://github.com/MediaBrowser/Emby.Kodi/wiki", 0)
|
||||||
|
xbmcgui.Dialog().ok("Emby Warning", "Cancelling the database syncing process. Current Kodi version: %s is unsupported. Please verify your logs for more info." % xbmc.getInfoLabel('System.BuildVersion'))
|
||||||
|
break
|
||||||
|
|
||||||
# Run full sync
|
# Run full sync
|
||||||
self.logMsg("DB Version: " + utils.settings("dbCreatedWithVersion"), 0)
|
self.logMsg("DB Version: " + utils.settings("dbCreatedWithVersion"), 0)
|
||||||
self.logMsg("Doing_Db_Sync: syncDatabase (Started)", 1)
|
self.logMsg("Doing_Db_Sync: syncDatabase (Started)", 1)
|
||||||
|
|
|
@ -56,58 +56,43 @@ def KodiSQL(type="video"):
|
||||||
if type == "music":
|
if type == "music":
|
||||||
dbPath = getKodiMusicDBPath()
|
dbPath = getKodiMusicDBPath()
|
||||||
elif type == "texture":
|
elif type == "texture":
|
||||||
dbPath = xbmc.translatePath("special://database/Textures13.db")
|
dbPath = xbmc.translatePath("special://database/Textures13.db").decode('utf-8')
|
||||||
else:
|
else:
|
||||||
dbPath = getKodiVideoDBPath()
|
dbPath = getKodiVideoDBPath()
|
||||||
|
|
||||||
connection = sqlite3.connect(dbPath)
|
connection = sqlite3.connect(dbPath)
|
||||||
|
|
||||||
return connection
|
return connection
|
||||||
|
|
||||||
def getKodiVideoDBPath():
|
def getKodiVideoDBPath():
|
||||||
|
|
||||||
kodibuild = xbmc.getInfoLabel("System.BuildVersion")
|
kodibuild = xbmc.getInfoLabel('System.BuildVersion')[:2]
|
||||||
|
dbVersion = {
|
||||||
|
|
||||||
if kodibuild.startswith("13"):
|
"13": 78, # Gotham
|
||||||
# Gotham
|
"14": 90, # Helix
|
||||||
dbVersion = "78"
|
"15": 93, # Isengard
|
||||||
elif kodibuild.startswith("14"):
|
"16": 99 # Jarvis
|
||||||
# Helix
|
}
|
||||||
dbVersion = "90"
|
|
||||||
elif kodibuild.startswith("15"):
|
|
||||||
# Isengard
|
|
||||||
dbVersion = "93"
|
|
||||||
elif kodibuild.startswith("16"):
|
|
||||||
# Jarvis
|
|
||||||
dbVersion = "99"
|
|
||||||
else:
|
|
||||||
# Not a compatible build
|
|
||||||
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
|
||||||
|
|
||||||
dbPath = xbmc.translatePath("special://profile/Database/MyVideos" + dbVersion + ".db")
|
|
||||||
|
|
||||||
|
dbPath = xbmc.translatePath(
|
||||||
|
"special://database/MyVideos%s.db"
|
||||||
|
% dbVersion.get(kodibuild, "")).decode('utf-8')
|
||||||
return dbPath
|
return dbPath
|
||||||
|
|
||||||
def getKodiMusicDBPath():
|
def getKodiMusicDBPath():
|
||||||
if xbmc.getInfoLabel("System.BuildVersion").startswith("13"):
|
|
||||||
#gotham
|
|
||||||
dbVersion = "46"
|
|
||||||
elif xbmc.getInfoLabel("System.BuildVersion").startswith("14"):
|
|
||||||
#helix
|
|
||||||
dbVersion = "48"
|
|
||||||
elif xbmc.getInfoLabel("System.BuildVersion").startswith("15"):
|
|
||||||
#isengard
|
|
||||||
dbVersion = "52"
|
|
||||||
elif xbmc.getInfoLabel("System.BuildVersion").startswith("16"):
|
|
||||||
#jarvis
|
|
||||||
dbVersion = "55"
|
|
||||||
else:
|
|
||||||
# Not a compatible build
|
|
||||||
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
|
||||||
|
|
||||||
|
kodibuild = xbmc.getInfoLabel('System.BuildVersion')[:2]
|
||||||
|
dbVersion = {
|
||||||
|
|
||||||
dbPath = xbmc.translatePath("special://profile/Database/MyMusic" + dbVersion + ".db")
|
"13": 46, # Gotham
|
||||||
|
"14": 48, # Helix
|
||||||
|
"15": 52, # Isengard
|
||||||
|
"16": 55 # Jarvis
|
||||||
|
}
|
||||||
|
|
||||||
|
dbPath = xbmc.translatePath(
|
||||||
|
"special://database/MyMusic%s.db"
|
||||||
|
% dbVersion.get(kodibuild, "")).decode('utf-8')
|
||||||
return dbPath
|
return dbPath
|
||||||
|
|
||||||
def prettifyXml(elem):
|
def prettifyXml(elem):
|
||||||
|
|
Loading…
Reference in a new issue