Skip to content

Commit

Permalink
Skip updating lists if it's empty
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 10, 2024
1 parent c3bc331 commit a5936e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plextraktsync/sync/Sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def sync(self, walker: Walker, dry_run=False):
self.walker = walker
trakt_lists = TraktUserListCollection()
is_partial = walker.is_partial and not dry_run
add_to_lists = not is_partial

from plextraktsync.sync.plugin import SyncPluginManager
pm = SyncPluginManager()
Expand All @@ -53,11 +52,14 @@ 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)

if self.config.update_plex_wl_as_pl:
if not add_to_lists:
if is_partial:
self.logger.warning("Running partial library sync. Watchlist as playlist won't update because it needs full library sync.")
else:
trakt_lists.add_watchlist(self.trakt.watchlist_movies)

# 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)
Expand Down

0 comments on commit a5936e8

Please sign in to comment.