fix crash on sync when song rating is null in db (if user didn't reset the db)

resync is advised however to make sure the rating gets scraped initially
This commit is contained in:
marcelveldt 2016-01-18 16:31:07 +01:00
parent 72d279a3a9
commit 5640408523

View file

@ -2222,7 +2222,9 @@ class Music(Items):
else: else:
query = "SELECT rating FROM song WHERE idSong = ?" query = "SELECT rating FROM song WHERE idSong = ?"
kodicursor.execute(query, (kodiid,)) kodicursor.execute(query, (kodiid,))
try:
currentvalue = int(round(float(kodicursor.fetchone()[0]),0)) currentvalue = int(round(float(kodicursor.fetchone()[0]),0))
except: currentvalue = None
# Only proceed if we actually have a rating from the file # Only proceed if we actually have a rating from the file
if file_rating is None and currentvalue: if file_rating is None and currentvalue: