From 60957668f30ef8ef1b4ff49d29499e2eeaae5565 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Tue, 5 May 2015 18:40:53 +0200 Subject: [PATCH] fix for playcount reported wrong by Kodi unwatched items are calculated when the playcount is set to NULL in the database and not 0 --- resources/lib/WriteKodiDB.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/lib/WriteKodiDB.py b/resources/lib/WriteKodiDB.py index 954d84a4..697c65d0 100644 --- a/resources/lib/WriteKodiDB.py +++ b/resources/lib/WriteKodiDB.py @@ -116,6 +116,8 @@ class WriteKodiDB(): playcount = 0 if userData.get("PlayCount") == "1": playcount = 1 + else: + playcount = None #playcount must be set to NULL in the db #### ADD OR UPDATE THE FILE AND PATH ########### #### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY @@ -260,6 +262,8 @@ class WriteKodiDB(): playcount = 0 if userData.get("PlayCount") == "1": playcount = 1 + else: + playcount = None #playcount must be set to NULL in the db #### ADD OR UPDATE THE FILE AND PATH ########### #### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY @@ -533,6 +537,8 @@ class WriteKodiDB(): playcount = None if userData.get("PlayCount") == "1": playcount = 1 + else: + playcount = None #playcount must be set to NULL in the db #### ADD OR UPDATE THE FILE AND PATH ########### #### NOTE THAT LASTPLAYED AND PLAYCOUNT ARE STORED AT THE FILE ENTRY