mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 10:46:11 +00:00
Revert db change
This commit is contained in:
parent
aa156a5a63
commit
83080815ba
1 changed files with 28 additions and 26 deletions
|
@ -63,35 +63,37 @@ def KodiSQL(type="video"):
|
||||||
|
|
||||||
def getKodiVideoDBPath():
|
def getKodiVideoDBPath():
|
||||||
|
|
||||||
dirs, files = xbmcvfs.listdir("special://database")
|
kodibuild = xbmc.getInfoLabel("System.BuildVersion")
|
||||||
dbVersions = {}
|
|
||||||
|
|
||||||
for database in files:
|
if kodibuild.startswith("13"):
|
||||||
if "MyVideos" in database and database.endswith("db"):
|
# Gotham
|
||||||
version = database[len("MyVideos"):-len(".db")]
|
dbVersion = "78"
|
||||||
dbVersions[int(version)] = database
|
elif kodibuild.startswith("14"):
|
||||||
# Sort by highest version number
|
# Helix
|
||||||
versions = sorted(dbVersions.keys(), reverse=True)
|
dbVersion = "90"
|
||||||
|
elif kodibuild.startswith("15"):
|
||||||
|
# Isengard
|
||||||
|
dbVersion = "93"
|
||||||
|
else:
|
||||||
|
# Not a compatible build
|
||||||
|
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
||||||
|
|
||||||
dbPath = xbmc.translatePath("special://database/%s" % dbVersions[versions[0]])
|
dbPath = xbmc.translatePath("special://profile/Database/MyVideos" + dbVersion + ".db")
|
||||||
logMsg("Utils", "Path to Video database: %s" % dbPath, 0)
|
|
||||||
|
|
||||||
return dbPath
|
return dbPath
|
||||||
|
|
||||||
def getKodiMusicDBPath():
|
def getKodiMusicDBPath():
|
||||||
|
if xbmc.getInfoLabel("System.BuildVersion").startswith("13"):
|
||||||
|
#gotham
|
||||||
|
dbVersion = "46"
|
||||||
|
elif xbmc.getInfoLabel("System.BuildVersion").startswith("15"):
|
||||||
|
#isengard
|
||||||
|
dbVersion = "52"
|
||||||
|
else:
|
||||||
|
#helix
|
||||||
|
dbVersion = "48"
|
||||||
|
|
||||||
dirs, files = xbmcvfs.listdir("special://database")
|
dbPath = xbmc.translatePath("special://profile/Database/MyMusic" + dbVersion + ".db")
|
||||||
dbVersions = {}
|
|
||||||
|
|
||||||
for database in files:
|
|
||||||
if "MyMusic" in database and database.endswith("db"):
|
|
||||||
version = database[len("MyMusic"):-len(".db")]
|
|
||||||
dbVersions[int(version)] = database
|
|
||||||
# Sort by highest version number
|
|
||||||
versions = sorted(dbVersions.keys(), reverse=True)
|
|
||||||
|
|
||||||
dbPath = xbmc.translatePath("special://database/%s" % dbVersions[versions[0]])
|
|
||||||
logMsg("Utils", "Path to Music database: %s" % dbPath, 0)
|
|
||||||
|
|
||||||
return dbPath
|
return dbPath
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue