Skip to content

Commit

Permalink
Skip trakt_lists logic from Sync class
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 28, 2024
1 parent e227444 commit 6091725
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions plextraktsync/sync/Sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from typing import TYPE_CHECKING

from plextraktsync.decorators.measure_time import measure_time
from plextraktsync.factory import logging
from plextraktsync.trakt.TraktUserListCollection import TraktUserListCollection

Expand Down Expand Up @@ -33,22 +32,11 @@ def sync(self, walker: Walker, dry_run=False):

pm.hook.init(sync=self, trakt_lists=trakt_lists, is_partial=is_partial, dry_run=dry_run)

# Skip updating lists if it's empty
add_to_lists = not trakt_lists.is_empty

if self.config.need_library_walk:
for movie in walker.find_movies():
pm.hook.walk_movie(movie=movie, dry_run=dry_run)
if add_to_lists:
trakt_lists.add_to_lists(movie)

for episode in walker.find_episodes():
pm.hook.walk_episode(episode=episode, dry_run=dry_run)
if add_to_lists:
trakt_lists.add_to_lists(episode)

if not dry_run and not trakt_lists.is_empty:
with measure_time("Updated liked list"):
trakt_lists.sync()

pm.hook.fini(walker=walker, trakt_lists=trakt_lists, dry_run=dry_run)

0 comments on commit 6091725

Please sign in to comment.