diff --git a/resources/lib/objects/actions.py b/resources/lib/objects/actions.py index 632bab44..ee4df5fb 100644 --- a/resources/lib/objects/actions.py +++ b/resources/lib/objects/actions.py @@ -278,7 +278,6 @@ class Actions(object): if not obj['Played']: obj['DatePlayed'] = None - elif obj['DatePlayed']: obj['DatePlayed'] = obj['DatePlayed'].split('.')[0].replace('T', " ") diff --git a/resources/lib/objects/movies.py b/resources/lib/objects/movies.py index cd28cc08..83b5d63f 100644 --- a/resources/lib/objects/movies.py +++ b/resources/lib/objects/movies.py @@ -87,7 +87,7 @@ class Movies(KodiDb): obj['Runtime'] = round(float((obj['Runtime'] or 0) / 10000000.0), 6) obj['People'] = API.get_people_artwork(obj['People']) obj['DateAdded'] = obj['DateAdded'].split('.')[0].replace('T', " ") - obj['DatePlayed'] = (obj['DatePlayed'] or obj['DateAdded']).split('.')[0].replace('T', " ") + obj['DatePlayed'] = None if not obj['Played'] else (obj['DatePlayed'] or obj['DateAdded']).split('.')[0].replace('T', " ") obj['PlayCount'] = API.get_playcount(obj['Played'], obj['PlayCount']) obj['Artwork'] = API.get_all_artwork(self.objects.map(item, 'Artwork')) obj['Video'] = API.video_streams(obj['Video'] or [], obj['Container']) @@ -299,7 +299,9 @@ class Movies(KodiDb): obj['Runtime'] = round(float((obj['Runtime'] or 0) / 10000000.0), 6) obj['PlayCount'] = API.get_playcount(obj['Played'], obj['PlayCount']) - if obj['DatePlayed']: + if not obj['Played']: + obj['DatePlayed'] = None + elif obj['DatePlayed']: obj['DatePlayed'] = obj['DatePlayed'].split('.')[0].replace('T', " ") if obj['Favorite']: diff --git a/resources/lib/objects/music.py b/resources/lib/objects/music.py index c1b2a572..05108bb7 100644 --- a/resources/lib/objects/music.py +++ b/resources/lib/objects/music.py @@ -273,7 +273,9 @@ class Music(KodiDb): if obj['DateAdded']: obj['DateAdded'] = obj['DateAdded'].split('.')[0].replace('T', " ") - if obj['DateAdded'] or obj['DatePlayed']: + if not obj['Played']: + obj['DatePlayed'] = None + elif obj['DateAdded'] or obj['DatePlayed']: obj['DatePlayed'] = (obj['DatePlayed'] or obj['DateAdded']).split('.')[0].replace('T', " ") if obj['Disc'] != 1: @@ -434,7 +436,9 @@ class Music(KodiDb): if obj['Media'] == 'song': - if obj['DatePlayed']: + if not obj['Played']: + obj['DatePlayed'] = None + elif obj['DatePlayed']: obj['DatePlayed'] = obj['DatePlayed'].split('.')[0].replace('T', " ") self.rate_song(*values(obj, QU.update_song_rating_obj)) diff --git a/resources/lib/objects/musicvideos.py b/resources/lib/objects/musicvideos.py index 063ff0b6..3e178b54 100644 --- a/resources/lib/objects/musicvideos.py +++ b/resources/lib/objects/musicvideos.py @@ -80,7 +80,7 @@ class MusicVideos(KodiDb): obj['Studios'] = [API.validate_studio(studio) for studio in (obj['Studios'] or [])] obj['Plot'] = API.get_overview(obj['Plot']) obj['DateAdded'] = obj['DateAdded'].split('.')[0].replace('T', " ") - obj['DatePlayed'] = (obj['DatePlayed'] or obj['DateAdded']).split('.')[0].replace('T', " ") + obj['DatePlayed'] = None if not obj['Played'] else (obj['DatePlayed'] or obj['DateAdded']).split('.')[0].replace('T', " ") obj['PlayCount'] = API.get_playcount(obj['Played'], obj['PlayCount']) obj['Resume'] = API.adjust_resume((obj['Resume'] or 0) / 10000000.0) obj['Runtime'] = round(float((obj['Runtime'] or 0) / 10000000.0), 6) @@ -200,7 +200,9 @@ class MusicVideos(KodiDb): obj['Runtime'] = round(float((obj['Runtime'] or 0) / 10000000.0), 6) obj['PlayCount'] = API.get_playcount(obj['Played'], obj['PlayCount']) - if obj['DatePlayed']: + if not obj['Played']: + obj['DatePlayed'] = None + elif obj['DatePlayed']: obj['DatePlayed'] = obj['DatePlayed'].split('.')[0].replace('T', " ") if obj['Favorite']: diff --git a/resources/lib/objects/tvshows.py b/resources/lib/objects/tvshows.py index c4ab9142..6d40471a 100644 --- a/resources/lib/objects/tvshows.py +++ b/resources/lib/objects/tvshows.py @@ -286,7 +286,7 @@ class TVShows(KodiDb): obj['Runtime'] = round(float((obj['Runtime'] or 0) / 10000000.0), 6) obj['People'] = API.get_people_artwork(obj['People'] or []) obj['DateAdded'] = obj['DateAdded'].split('.')[0].replace('T', " ") - obj['DatePlayed'] = (obj['DatePlayed'] or obj['DateAdded']).split('.')[0].replace('T', " ") + obj['DatePlayed'] = None if not obj['Played'] else (obj['DatePlayed'] or obj['DateAdded']).split('.')[0].replace('T', " ") obj['PlayCount'] = API.get_playcount(obj['Played'], obj['PlayCount']) obj['Artwork'] = API.get_all_artwork(self.objects.map(item, 'Artwork')) obj['Video'] = API.video_streams(obj['Video'] or [], obj['Container']) @@ -451,7 +451,9 @@ class TVShows(KodiDb): obj['Runtime'] = round(float((obj['Runtime'] or 0) / 10000000.0), 6) obj['PlayCount'] = API.get_playcount(obj['Played'], obj['PlayCount']) - if obj['DatePlayed']: + if not obj['Played']: + obj['DatePlayed'] = None + elif obj['DatePlayed']: obj['DatePlayed'] = obj['DatePlayed'].split('.')[0].replace('T', " ") if obj['DateAdded']: