Skip to content

Commit

Permalink
Async ratings sync
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 13, 2024
1 parent 2338512 commit 620b748
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plextraktsync/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async def sync(self, walker: Walker, dry_run=False):
movie_trakt_ids = set()
async for movie in walker.find_movies():
await self.sync_collection(movie, dry_run=dry_run)
self.sync_ratings(movie, dry_run=dry_run)
await self.sync_ratings(movie, dry_run=dry_run)
self.sync_watched(movie, dry_run=dry_run)
if not is_partial:
listutil.addPlexItemToLists(movie)
Expand All @@ -78,7 +78,7 @@ async def sync(self, walker: Walker, dry_run=False):
episode_trakt_ids = set()
async for episode in walker.find_episodes():
await self.sync_collection(episode, dry_run=dry_run)
self.sync_ratings(episode, dry_run=dry_run)
await self.sync_ratings(episode, dry_run=dry_run)
self.sync_watched(episode, dry_run=dry_run)
if not is_partial:
listutil.addPlexItemToLists(episode)
Expand All @@ -93,7 +93,7 @@ async def sync(self, walker: Walker, dry_run=False):
self.clear_collected(self.trakt.episodes_collection, episode_trakt_ids)

async for show in walker.walk_shows(shows, title="Syncing show ratings"):
self.sync_ratings(show, dry_run=dry_run)
await self.sync_ratings(show, dry_run=dry_run)

if self.config.update_plex_wl_as_pl or self.config.sync_liked_lists:
if is_partial:
Expand Down Expand Up @@ -127,7 +127,7 @@ async def sync_collection(self, m: Media, dry_run=False):
if not dry_run:
m.add_to_collection()

def sync_ratings(self, m: Media, dry_run=False):
async def sync_ratings(self, m: Media, dry_run=False):
if not self.config.sync_ratings:
return

Expand Down

0 comments on commit 620b748

Please sign in to comment.