mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-26 02:36:10 +00:00
support for kodi jarvis
This commit is contained in:
parent
335035d6f2
commit
7f21c61753
3 changed files with 18 additions and 12 deletions
|
@ -76,6 +76,9 @@ def getKodiVideoDBPath():
|
||||||
elif kodibuild.startswith("15"):
|
elif kodibuild.startswith("15"):
|
||||||
# Isengard
|
# Isengard
|
||||||
dbVersion = "93"
|
dbVersion = "93"
|
||||||
|
elif kodibuild.startswith("16"):
|
||||||
|
# Jarvis
|
||||||
|
dbVersion = "94"
|
||||||
else:
|
else:
|
||||||
# Not a compatible build
|
# Not a compatible build
|
||||||
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
||||||
|
@ -94,6 +97,9 @@ def getKodiMusicDBPath():
|
||||||
elif xbmc.getInfoLabel("System.BuildVersion").startswith("15"):
|
elif xbmc.getInfoLabel("System.BuildVersion").startswith("15"):
|
||||||
#isengard
|
#isengard
|
||||||
dbVersion = "52"
|
dbVersion = "52"
|
||||||
|
elif xbmc.getInfoLabel("System.BuildVersion").startswith("16"):
|
||||||
|
#jarvis
|
||||||
|
dbVersion = "53"
|
||||||
else:
|
else:
|
||||||
# Not a compatible build
|
# Not a compatible build
|
||||||
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
||||||
|
|
|
@ -163,7 +163,7 @@ class WriteKodiMusicDB():
|
||||||
if albumid:
|
if albumid:
|
||||||
self.logMsg("UPDATE album to Kodi library, Id: %s - Title: %s" % (embyId, name), 1)
|
self.logMsg("UPDATE album to Kodi library, Id: %s - Title: %s" % (embyId, name), 1)
|
||||||
|
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
query = "UPDATE album SET strAlbum = ?, strMusicBrainzAlbumID = ?, strArtists = ?, iYear = ?, strGenres = ?, strReview = ?, strImage = ?, lastScraped = ?, dateAdded = ?, strReleaseType = ? WHERE idAlbum = ?"
|
query = "UPDATE album SET strAlbum = ?, strMusicBrainzAlbumID = ?, strArtists = ?, iYear = ?, strGenres = ?, strReview = ?, strImage = ?, lastScraped = ?, dateAdded = ?, strReleaseType = ? WHERE idAlbum = ?"
|
||||||
cursor.execute(query, (name, musicBrainzId, artists, year, genre, bio, thumb, lastScraped, dateadded, "album", albumid))
|
cursor.execute(query, (name, musicBrainzId, artists, year, genre, bio, thumb, lastScraped, dateadded, "album", albumid))
|
||||||
|
@ -188,7 +188,7 @@ class WriteKodiMusicDB():
|
||||||
# Create the album
|
# Create the album
|
||||||
cursor.execute("select coalesce(max(idAlbum),0) as albumid from album")
|
cursor.execute("select coalesce(max(idAlbum),0) as albumid from album")
|
||||||
albumid = cursor.fetchone()[0] + 1
|
albumid = cursor.fetchone()[0] + 1
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
query = "INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID, strArtists, iYear, strGenres, strReview, strImage, lastScraped, dateAdded, strReleaseType) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
|
query = "INSERT INTO album(idAlbum, strAlbum, strMusicBrainzAlbumID, strArtists, iYear, strGenres, strReview, strImage, lastScraped, dateAdded, strReleaseType) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
|
||||||
cursor.execute(query, (albumid, name, musicBrainzId, artists, year, genre, bio, thumb, lastScraped, dateadded, "album"))
|
cursor.execute(query, (albumid, name, musicBrainzId, artists, year, genre, bio, thumb, lastScraped, dateadded, "album"))
|
||||||
|
@ -299,7 +299,7 @@ class WriteKodiMusicDB():
|
||||||
# No album found, create a single's album
|
# No album found, create a single's album
|
||||||
cursor.execute("select coalesce(max(idAlbum),0) as albumid from album")
|
cursor.execute("select coalesce(max(idAlbum),0) as albumid from album")
|
||||||
albumid = cursor.fetchone()[0] + 1
|
albumid = cursor.fetchone()[0] + 1
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
query = "INSERT INTO album(idAlbum, strArtists, strGenres, iYear, dateAdded, strReleaseType) values(?, ?, ?, ?, ?, ?)"
|
query = "INSERT INTO album(idAlbum, strArtists, strGenres, iYear, dateAdded, strReleaseType) values(?, ?, ?, ?, ?, ?)"
|
||||||
cursor.execute(query, (albumid, artists, genre, year, dateadded, "single"))
|
cursor.execute(query, (albumid, artists, genre, year, dateadded, "single"))
|
||||||
|
|
|
@ -831,8 +831,8 @@ class WriteKodiVideoDB():
|
||||||
name = person['Name']
|
name = person['Name']
|
||||||
type = person['Type']
|
type = person['Type']
|
||||||
|
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard/jarvis
|
||||||
cursor.execute("SELECT actor_id as actorid FROM actor WHERE name = ?", (name,))
|
cursor.execute("SELECT actor_id as actorid FROM actor WHERE name = ?", (name,))
|
||||||
else:
|
else:
|
||||||
# Kodi Gotham or Helix
|
# Kodi Gotham or Helix
|
||||||
|
@ -842,7 +842,7 @@ class WriteKodiVideoDB():
|
||||||
actorid = cursor.fetchone()[0]
|
actorid = cursor.fetchone()[0]
|
||||||
except:
|
except:
|
||||||
# Person entry does not exist yet.
|
# Person entry does not exist yet.
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
cursor.execute("select coalesce(max(actor_id),0) as actorid from actor")
|
cursor.execute("select coalesce(max(actor_id),0) as actorid from actor")
|
||||||
query = "INSERT INTO actor(actor_id, name) values(?, ?)"
|
query = "INSERT INTO actor(actor_id, name) values(?, ?)"
|
||||||
|
@ -867,7 +867,7 @@ class WriteKodiVideoDB():
|
||||||
self.addOrUpdateArt(thumb, actorid, arttype, "thumb", cursor)
|
self.addOrUpdateArt(thumb, actorid, arttype, "thumb", cursor)
|
||||||
|
|
||||||
# Link person to content in database
|
# Link person to content in database
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
if "Actor" in type:
|
if "Actor" in type:
|
||||||
Role = person.get('Role')
|
Role = person.get('Role')
|
||||||
|
@ -927,7 +927,7 @@ class WriteKodiVideoDB():
|
||||||
if genres:
|
if genres:
|
||||||
|
|
||||||
# Delete current genres for clean slate
|
# Delete current genres for clean slate
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
cursor.execute("DELETE FROM genre_link WHERE media_id = ? AND media_type = ?", (id, mediatype,))
|
cursor.execute("DELETE FROM genre_link WHERE media_id = ? AND media_type = ?", (id, mediatype,))
|
||||||
else:
|
else:
|
||||||
if "movie" in mediatype:
|
if "movie" in mediatype:
|
||||||
|
@ -940,7 +940,7 @@ class WriteKodiVideoDB():
|
||||||
# Add Genres
|
# Add Genres
|
||||||
for genre in genres:
|
for genre in genres:
|
||||||
|
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
cursor.execute("SELECT genre_id as genre_id FROM genre WHERE name = ?", (genre,))
|
cursor.execute("SELECT genre_id as genre_id FROM genre WHERE name = ?", (genre,))
|
||||||
try:
|
try:
|
||||||
|
@ -987,7 +987,7 @@ class WriteKodiVideoDB():
|
||||||
if countries:
|
if countries:
|
||||||
for country in countries:
|
for country in countries:
|
||||||
|
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
cursor.execute("SELECT country_id as country_id FROM country WHERE name = ?", (country,))
|
cursor.execute("SELECT country_id as country_id FROM country WHERE name = ?", (country,))
|
||||||
try:
|
try:
|
||||||
|
@ -1029,7 +1029,7 @@ class WriteKodiVideoDB():
|
||||||
if studios:
|
if studios:
|
||||||
for studio in studios:
|
for studio in studios:
|
||||||
|
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
cursor.execute("SELECT studio_id as studio_id FROM studio WHERE name = ?",(studio,))
|
cursor.execute("SELECT studio_id as studio_id FROM studio WHERE name = ?",(studio,))
|
||||||
try:
|
try:
|
||||||
|
@ -1076,7 +1076,7 @@ class WriteKodiVideoDB():
|
||||||
|
|
||||||
if tag:
|
if tag:
|
||||||
|
|
||||||
if kodiVersion == 15:
|
if kodiVersion == 15 or kodiVersion == 16:
|
||||||
# Kodi Isengard
|
# Kodi Isengard
|
||||||
cursor.execute("SELECT tag_id as tag_id FROM tag WHERE name = ?", (tag,))
|
cursor.execute("SELECT tag_id as tag_id FROM tag WHERE name = ?", (tag,))
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue