From 99113f198fd5181a052d43ba8c5f64e8656acb1e Mon Sep 17 00:00:00 2001 From: Kevin Richter Date: Sun, 11 Aug 2024 16:53:21 +0200 Subject: [PATCH] Revert changes to watch_at timestamp --- resources/lib/kodiUtilities.py | 4 ++-- resources/lib/utilities.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/lib/kodiUtilities.py b/resources/lib/kodiUtilities.py index c85fb486..3900539f 100644 --- a/resources/lib/kodiUtilities.py +++ b/resources/lib/kodiUtilities.py @@ -185,7 +185,7 @@ def kodiRpcToTraktMediaObject(type, data, mode="collected"): data["ids"] = utilities.guessBestTraktId(id, type)[0] if "lastplayed" in data: - episode["last_watched_at"] = utilities.to_iso8601_datetime(utilities.from_datetime(data["lastplayed"])) + episode["watched_at"] = utilities.to_iso8601_datetime(utilities.from_datetime(data["lastplayed"])) if "dateadded" in data: episode["collected_at"] = utilities.to_iso8601_datetime(utilities.from_datetime(data["dateadded"])) if "runtime" in data: @@ -204,7 +204,7 @@ def kodiRpcToTraktMediaObject(type, data, mode="collected"): if checkExclusion(data.pop("file")): return if "lastplayed" in data: - data["last_watched_at"] = utilities.to_iso8601_datetime(utilities.from_datetime(data.pop("lastplayed"))) + data["watched_at"] = utilities.to_iso8601_datetime(utilities.from_datetime(data.pop("lastplayed"))) if "dateadded" in data: data["collected_at"] = utilities.to_iso8601_datetime(utilities.from_datetime(data.pop("dateadded"))) if data["playcount"] is None: diff --git a/resources/lib/utilities.py b/resources/lib/utilities.py index bed54087..b1bff23d 100644 --- a/resources/lib/utilities.py +++ b/resources/lib/utilities.py @@ -726,7 +726,7 @@ def updateTraktLastWatchedBasedOnResetAt(trakt_shows, update_specials=False): if not update_specials and season["number"] == 0: continue for episode in season["episodes"]: - last_watched = from_iso8601_datetime(episode["last_watched_at"]) - if last_watched and last_watched < reset_at: - episode["last_watched_at"] = None + watched_at = from_iso8601_datetime(episode["watched_at"]) + if watched_at and watched_at < reset_at: + episode["watched_at"] = None episode["plays"] = 0