Skip to content

Commit

Permalink
Revert changes to watch_at timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
beschoenen committed Aug 11, 2024
1 parent 695a3e2 commit 99113f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions resources/lib/kodiUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions resources/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 99113f1

Please sign in to comment.