Skip to content

Commit

Permalink
Add walk movie/episode hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 8, 2024
1 parent 8f81247 commit b155bf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plextraktsync/sync/Sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def sync(self, walker: Walker, dry_run=False):
if self.config.need_library_walk:
movie_trakt_ids = set()
for movie in walker.find_movies():
pm.hook.walk_movie(movie=movie, dry_run=dry_run)
self.sync_collection(movie, dry_run=dry_run)
self.sync_ratings(movie, dry_run=dry_run)
self.sync_watched(movie, dry_run=dry_run)
Expand All @@ -80,10 +81,12 @@ def sync(self, walker: Walker, dry_run=False):

if movie_trakt_ids:
self.clear_collected(self.trakt.movie_collection, movie_trakt_ids)
pm.hook.fini(dry_run=dry_run)

shows = set()
episode_trakt_ids = set()
for episode in walker.find_episodes():
pm.hook.walk_episode(episode=episode, dry_run=dry_run)
self.sync_collection(episode, dry_run=dry_run)
self.sync_ratings(episode, dry_run=dry_run)
self.sync_watched(episode, dry_run=dry_run)
Expand Down

0 comments on commit b155bf3

Please sign in to comment.