mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-10 12:16:12 +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"):
|
||||
# Isengard
|
||||
dbVersion = "93"
|
||||
elif kodibuild.startswith("16"):
|
||||
# Jarvis
|
||||
dbVersion = "94"
|
||||
else:
|
||||
# Not a compatible build
|
||||
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
||||
|
@ -94,6 +97,9 @@ def getKodiMusicDBPath():
|
|||
elif xbmc.getInfoLabel("System.BuildVersion").startswith("15"):
|
||||
#isengard
|
||||
dbVersion = "52"
|
||||
elif xbmc.getInfoLabel("System.BuildVersion").startswith("16"):
|
||||
#jarvis
|
||||
dbVersion = "53"
|
||||
else:
|
||||
# Not a compatible build
|
||||
xbmc.log("This Kodi version is incompatible. Current version: %s" % kodibuild)
|
||||
|
|
|
@ -163,7 +163,7 @@ class WriteKodiMusicDB():
|
|||
if albumid:
|
||||
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
|
||||
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))
|
||||
|
@ -188,7 +188,7 @@ class WriteKodiMusicDB():
|
|||
# Create the album
|
||||
cursor.execute("select coalesce(max(idAlbum),0) as albumid from album")
|
||||
albumid = cursor.fetchone()[0] + 1
|
||||
if kodiVersion == 15:
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard
|
||||
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"))
|
||||
|
@ -299,7 +299,7 @@ class WriteKodiMusicDB():
|
|||
# No album found, create a single's album
|
||||
cursor.execute("select coalesce(max(idAlbum),0) as albumid from album")
|
||||
albumid = cursor.fetchone()[0] + 1
|
||||
if kodiVersion == 15:
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard
|
||||
query = "INSERT INTO album(idAlbum, strArtists, strGenres, iYear, dateAdded, strReleaseType) values(?, ?, ?, ?, ?, ?)"
|
||||
cursor.execute(query, (albumid, artists, genre, year, dateadded, "single"))
|
||||
|
|
|
@ -831,8 +831,8 @@ class WriteKodiVideoDB():
|
|||
name = person['Name']
|
||||
type = person['Type']
|
||||
|
||||
if kodiVersion == 15:
|
||||
# Kodi Isengard
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard/jarvis
|
||||
cursor.execute("SELECT actor_id as actorid FROM actor WHERE name = ?", (name,))
|
||||
else:
|
||||
# Kodi Gotham or Helix
|
||||
|
@ -842,7 +842,7 @@ class WriteKodiVideoDB():
|
|||
actorid = cursor.fetchone()[0]
|
||||
except:
|
||||
# Person entry does not exist yet.
|
||||
if kodiVersion == 15:
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard
|
||||
cursor.execute("select coalesce(max(actor_id),0) as actorid from actor")
|
||||
query = "INSERT INTO actor(actor_id, name) values(?, ?)"
|
||||
|
@ -867,7 +867,7 @@ class WriteKodiVideoDB():
|
|||
self.addOrUpdateArt(thumb, actorid, arttype, "thumb", cursor)
|
||||
|
||||
# Link person to content in database
|
||||
if kodiVersion == 15:
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard
|
||||
if "Actor" in type:
|
||||
Role = person.get('Role')
|
||||
|
@ -927,7 +927,7 @@ class WriteKodiVideoDB():
|
|||
if genres:
|
||||
|
||||
# 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,))
|
||||
else:
|
||||
if "movie" in mediatype:
|
||||
|
@ -940,7 +940,7 @@ class WriteKodiVideoDB():
|
|||
# Add Genres
|
||||
for genre in genres:
|
||||
|
||||
if kodiVersion == 15:
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard
|
||||
cursor.execute("SELECT genre_id as genre_id FROM genre WHERE name = ?", (genre,))
|
||||
try:
|
||||
|
@ -987,7 +987,7 @@ class WriteKodiVideoDB():
|
|||
if countries:
|
||||
for country in countries:
|
||||
|
||||
if kodiVersion == 15:
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard
|
||||
cursor.execute("SELECT country_id as country_id FROM country WHERE name = ?", (country,))
|
||||
try:
|
||||
|
@ -1029,7 +1029,7 @@ class WriteKodiVideoDB():
|
|||
if studios:
|
||||
for studio in studios:
|
||||
|
||||
if kodiVersion == 15:
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard
|
||||
cursor.execute("SELECT studio_id as studio_id FROM studio WHERE name = ?",(studio,))
|
||||
try:
|
||||
|
@ -1076,7 +1076,7 @@ class WriteKodiVideoDB():
|
|||
|
||||
if tag:
|
||||
|
||||
if kodiVersion == 15:
|
||||
if kodiVersion == 15 or kodiVersion == 16:
|
||||
# Kodi Isengard
|
||||
cursor.execute("SELECT tag_id as tag_id FROM tag WHERE name = ?", (tag,))
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue