Simplify items() body
Instead of nested generator just create instance in the loop body
MODIFY
plex_trakt_sync/plex_api.py
plex_trakt_sync/plex_api.py
@@ -385,8 +385,8 @@ def fetch_items(self, key: str, size: int, start: int):
return self.section.fetchItems(key, container_start=start, container_size=size)
def items(self, max_items: int):
- for item in (PlexLibraryItem(x) for x in self.all(max_items)):
- yield item
+ for item in self.all(max_items):
+ yield PlexLibraryItem(item)
class PlexApi:

Simplify items() body

Instead of nested generator just create instance in the loop body