From 9005ad84be8b12eaf101034e5737cfee01908b3a Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 7 Sep 2018 13:10:14 -0500 Subject: [PATCH] Fix DatePlayed DatePlayed should be empty when unwatched. And other minor fixes. --- resources/language/resource.language.en_gb/strings.po | 2 +- resources/lib/connect.py | 1 - resources/lib/objects/actions.py | 9 +++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 89516663..7b720177 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -667,7 +667,7 @@ msgid "Add server" msgstr "" msgctxt "#33135" -msgid "Kodi will now restart to apply a small patch for your database version." +msgid "Kodi will now restart to apply a small patch for your Kodi version." msgstr "" msgctxt "#33136" diff --git a/resources/lib/connect.py b/resources/lib/connect.py index 02e2e1c3..0feefa79 100644 --- a/resources/lib/connect.py +++ b/resources/lib/connect.py @@ -197,7 +197,6 @@ class Connect(object): else: raise RuntimeError("No server selected") - LOG.info(self.client.get_credentials()) return self.select_servers() def setup_manual_server(self): diff --git a/resources/lib/objects/actions.py b/resources/lib/objects/actions.py index 4b8b38e8..632bab44 100644 --- a/resources/lib/objects/actions.py +++ b/resources/lib/objects/actions.py @@ -276,7 +276,10 @@ class Actions(object): if obj['Premiere']: obj['Premiere'] = obj['Premiere'].split('T')[0] - if obj['DatePlayed']: + if not obj['Played']: + obj['DatePlayed'] = None + + elif obj['DatePlayed']: obj['DatePlayed'] = obj['DatePlayed'].split('.')[0].replace('T', " ") metadata = { @@ -420,7 +423,9 @@ class Actions(object): obj['PlayCount'] = API.get_playcount(obj['Played'], obj['PlayCount']) or 0 obj['Rating'] = obj['Rating'] or 0 - if obj['FileDate'] or obj['DatePlayed']: + if not obj['Played']: + obj['DatePlayed'] = None + elif obj['FileDate'] or obj['DatePlayed']: obj['DatePlayed'] = (obj['DatePlayed'] or obj['FileDate']).split('.')[0].replace('T', " ") obj['FileDate'] = "%s.%s.%s" % tuple(reversed(obj['FileDate'].split('T')[0].split('-')))