mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
few small fixes for bugs in test mysql code
This commit is contained in:
parent
cb8df35a1e
commit
95a5665ad0
1 changed files with 14 additions and 16 deletions
|
@ -84,10 +84,10 @@ def checkKodiSources():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def KodiSQL():
|
def KodiSQL():
|
||||||
if xbmc.getinfolabel("System.BuildVersion").startswith("13"):
|
if xbmc.getInfoLabel("System.BuildVersion").startswith("13"):
|
||||||
#gotham
|
#gotham
|
||||||
dbVersion = "78"
|
dbVersion = "78"
|
||||||
if xbmc.getinfolabel("System.BuildVersion").startswith("15"):
|
if xbmc.getInfoLabel("System.BuildVersion").startswith("15"):
|
||||||
#isengard
|
#isengard
|
||||||
dbVersion = "91"
|
dbVersion = "91"
|
||||||
else:
|
else:
|
||||||
|
@ -142,20 +142,18 @@ def addKodiSource(name, path, type):
|
||||||
|
|
||||||
|
|
||||||
error = False
|
error = False
|
||||||
if xbmcvfs.exists(dbPath):
|
|
||||||
try:
|
try:
|
||||||
connection = KodiSQL()
|
connection = KodiSQL()
|
||||||
cursor = connection.cursor( )
|
cursor = connection.cursor( )
|
||||||
cursor.execute("select coalesce(max(idPath),0) as pathId from path")
|
cursor.execute("select coalesce(max(idPath),0) as pathId from path")
|
||||||
pathId = cursor.fetchone()[0]
|
pathId = cursor.fetchone()[0]
|
||||||
pathId = pathId + 1
|
pathId = pathId + 1
|
||||||
pathsql="insert into path(idPath, strPath, strContent, strScraper, strHash, scanRecursive) values(?, ?, ?, ?, ?, ?)"
|
pathsql="insert into path(idPath, strPath, strContent, strScraper, strHash, scanRecursive) values(?, ?, ?, ?, ?, ?)"
|
||||||
cursor.execute(pathsql, (pathId,path + os.sep,type,"metadata.local",None,2147483647))
|
cursor.execute(pathsql, (pathId,path + os.sep,type,"metadata.local",None,2147483647))
|
||||||
connection.commit()
|
connection.commit()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
except:
|
except:
|
||||||
error = True
|
|
||||||
else:
|
|
||||||
error = True
|
error = True
|
||||||
|
|
||||||
# add it to sources.xml
|
# add it to sources.xml
|
||||||
|
|
Loading…
Reference in a new issue