Ensure Jarvis compatibility

This commit is contained in:
tomkat83 2017-01-09 20:37:24 +01:00
parent 8acf07c607
commit 087a6ff465

View file

@ -267,7 +267,7 @@ class Movies(Items):
% (itemid, title)) % (itemid, title))
# Update the movie entry # Update the movie entry
if KODIVERSION > 16: if KODIVERSION >= 17:
# update new ratings Kodi 17 # update new ratings Kodi 17
ratingid = self.kodi_db.get_ratingid(movieid) ratingid = self.kodi_db.get_ratingid(movieid)
self.kodi_db.update_ratings(movieid, self.kodi_db.update_ratings(movieid,
@ -314,7 +314,7 @@ class Movies(Items):
##### OR ADD THE MOVIE ##### ##### OR ADD THE MOVIE #####
else: else:
log.info("ADD movie itemid: %s - Title: %s" % (itemid, title)) log.info("ADD movie itemid: %s - Title: %s" % (itemid, title))
if KODIVERSION > 16: if KODIVERSION >= 17:
# add new ratings Kodi 17 # add new ratings Kodi 17
ratingid = self.kodi_db.create_entry_rating() ratingid = self.kodi_db.create_entry_rating()
self.kodi_db.add_ratings(ratingid, self.kodi_db.add_ratings(ratingid,
@ -848,7 +848,7 @@ class TVShows(Items):
log.info("UPDATE episode itemid: %s" % (itemid)) log.info("UPDATE episode itemid: %s" % (itemid))
# Update the movie entry # Update the movie entry
if KODIVERSION in (16, 17): if KODIVERSION in >= 16:
# Kodi Jarvis, Krypton # Kodi Jarvis, Krypton
query = ' '.join(( query = ' '.join((
"UPDATE episode", "UPDATE episode",
@ -881,7 +881,7 @@ class TVShows(Items):
else: else:
log.info("ADD episode itemid: %s - Title: %s" % (itemid, title)) log.info("ADD episode itemid: %s - Title: %s" % (itemid, title))
# Create the episode entry # Create the episode entry
if KODIVERSION in (16, 17): if KODIVERSION >= 16:
# Kodi Jarvis, Krypton # Kodi Jarvis, Krypton
query = ( query = (
''' '''
@ -1199,7 +1199,7 @@ class Music(Items):
checksum=checksum) checksum=checksum)
# Process the artist # Process the artist
if KODIVERSION in (16, 17): if KODIVERSION >= 16:
query = ' '.join(( query = ' '.join((
"UPDATE artist", "UPDATE artist",
@ -1295,7 +1295,7 @@ class Music(Items):
checksum=checksum) checksum=checksum)
# Process the album info # Process the album info
if KODIVERSION == 17: if KODIVERSION >= 17:
# Kodi Krypton # Kodi Krypton
query = ' '.join(( query = ' '.join((
@ -1568,7 +1568,7 @@ class Music(Items):
log.info("Failed to add album. Creating singles.") log.info("Failed to add album. Creating singles.")
kodicursor.execute("select coalesce(max(idAlbum),0) from album") kodicursor.execute("select coalesce(max(idAlbum),0) from album")
albumid = kodicursor.fetchone()[0] + 1 albumid = kodicursor.fetchone()[0] + 1
if KODIVERSION == 16: if KODIVERSION >= 16:
# Kodi Jarvis # Kodi Jarvis
query = ( query = (
''' '''
@ -1733,7 +1733,7 @@ class Music(Items):
result = kodicursor.fetchone() result = kodicursor.fetchone()
if result and result[0] != album_artists: if result and result[0] != album_artists:
# Field is empty # Field is empty
if KODIVERSION in (16, 17): if KODIVERSION >= 16:
# Kodi Jarvis, Krypton # Kodi Jarvis, Krypton
query = "UPDATE album SET strArtists = ? WHERE idAlbum = ?" query = "UPDATE album SET strArtists = ? WHERE idAlbum = ?"
kodicursor.execute(query, (album_artists, albumid)) kodicursor.execute(query, (album_artists, albumid))