Update mark_watched to use queue.add_to_history
from plextraktsync.decorators.time_limit import time_limit
from plextraktsync.factory import factory, logger
from plextraktsync.path import pytrakt_file
+from plextraktsync.trakt.PartialTraktMedia import PartialTraktMedia
from plextraktsync.trakt.TraktLookup import TraktLookup
from plextraktsync.trakt.TraktRatingCollection import TraktRatingCollection
from plextraktsync.trakt.types import TraktMedia
@@ -164,7 +165,6 @@ def rate(self, m, rating):
@time_limit()
@retry()
def mark_watched(self, m: TraktMedia, time, show_trakt_id=None):
- m.mark_as_seen(time)
if m.media_type == "movies":
self.watched_movies.add(m.trakt)
elif m.media_type == "episodes" and show_trakt_id:
@@ -172,6 +172,10 @@ def mark_watched(self, m: TraktMedia, time, show_trakt_id=None):
else:
raise RuntimeError(f"mark_watched: Unsupported media type: {m.media_type}")
+ # Add partial object to conserve memory
+ partial = PartialTraktMedia.create(m)
+ self.queue.add_to_history((partial, time))
+
def add_to_collection(self, m, pm: PlexLibraryItem):
if m.media_type == "movies":
item = dict(
