From 5640408523b497148371987038af19ff58153a4d Mon Sep 17 00:00:00 2001 From: marcelveldt Date: Mon, 18 Jan 2016 16:31:07 +0100 Subject: [PATCH] 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 --- resources/lib/itemtypes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 7559d28c..dbe2664f 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -2222,7 +2222,9 @@ class Music(Items): else: query = "SELECT rating FROM song WHERE idSong = ?" kodicursor.execute(query, (kodiid,)) - currentvalue = int(round(float(kodicursor.fetchone()[0]),0)) + try: + currentvalue = int(round(float(kodicursor.fetchone()[0]),0)) + except: currentvalue = None # Only proceed if we actually have a rating from the file if file_rating is None and currentvalue: