Skip to content

Commit

Permalink
Make walk_movie and walk_episode in plugins async
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 16, 2024
1 parent 24b2bc2 commit dbf5bbd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions plextraktsync/sync/AddCollectionPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def factory(cls, sync: Sync):
return cls()

@hookimpl
def walk_movie(self, movie: Media, dry_run: bool):
async def walk_movie(self, movie: Media, dry_run: bool):
self.sync_collection(movie, dry_run=dry_run)

@hookimpl
def walk_episode(self, episode: Media, dry_run: bool):
async def walk_episode(self, episode: Media, dry_run: bool):
self.sync_collection(episode, dry_run=dry_run)

def sync_collection(self, m: Media, dry_run: bool):
Expand Down
2 changes: 1 addition & 1 deletion plextraktsync/sync/ClearCollectedPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def fini(self, dry_run: bool):
self.clear_collected(self.trakt.episodes_collection, self.episode_trakt_ids, dry_run=dry_run)

@hookimpl
def walk_movie(self, movie: Media):
async def walk_movie(self, movie: Media):
if self.is_partial:
return

Expand Down
4 changes: 2 additions & 2 deletions plextraktsync/sync/SyncRatingsPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def factory(cls, sync: Sync):
return cls(config=sync.config)

@hookimpl
def walk_movie(self, movie: Media, dry_run: bool):
async def walk_movie(self, movie: Media, dry_run: bool):
self.sync_ratings(movie, dry_run=dry_run)

@hookimpl
def walk_episode(self, episode: Media, dry_run: bool):
async def walk_episode(self, episode: Media, dry_run: bool):
self.sync_ratings(episode, dry_run=dry_run)

if episode.show:
Expand Down
4 changes: 2 additions & 2 deletions plextraktsync/sync/SyncWatchedPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def factory(cls, sync: Sync):
return cls(config=sync.config)

@hookimpl
def walk_movie(self, movie: Media, dry_run: bool):
async def walk_movie(self, movie: Media, dry_run: bool):
self.sync_watched(movie, dry_run=dry_run)

@hookimpl
def walk_episode(self, episode: Media, dry_run: bool):
async def walk_episode(self, episode: Media, dry_run: bool):
self.sync_watched(episode, dry_run=dry_run)

def sync_watched(self, m: Media, dry_run: bool):
Expand Down
4 changes: 2 additions & 2 deletions plextraktsync/sync/WatchProgressPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def factory(cls, sync: Sync):
return cls(sync.trakt)

@hookimpl
def walk_movie(self, movie: Media, dry_run: bool):
async def walk_movie(self, movie: Media, dry_run: bool):
self.sync_progress(movie, dry_run=dry_run)

@hookimpl
def walk_episode(self, episode: Media, dry_run: bool):
async def walk_episode(self, episode: Media, dry_run: bool):
self.sync_progress(episode, dry_run=dry_run)

def sync_progress(self, m: Media, dry_run=False):
Expand Down

0 comments on commit dbf5bbd

Please sign in to comment.