From 0f793e6dbaf56cbf8376cdf6fcea851a3366431a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 14 Jan 2023 04:38:05 +0200 Subject: [PATCH 1/3] Print titles in print_plan --- plextraktsync/walker.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plextraktsync/walker.py b/plextraktsync/walker.py index 62b4cfec03..ffb10f49f8 100644 --- a/plextraktsync/walker.py +++ b/plextraktsync/walker.py @@ -247,19 +247,19 @@ def is_partial(self): def print_plan(self, print=print): if self.plan.movie_sections: - print(f"Sync Movie sections: {self.plan.movie_sections}") + print(f"Sync Movie sections: {[x.title for x in self.plan.movie_sections]}") if self.plan.show_sections: - print(f"Sync Show sections: {self.plan.show_sections}") + print(f"Sync Show sections: {[x.title for x in self.plan.show_sections]}") if self.plan.movies: - print(f"Sync Movies: {self.plan.movies}") + print(f"Sync Movies: {[x.title for x in self.plan.movies]}") if self.plan.shows: - print(f"Sync Shows: {self.plan.shows}") + print(f"Sync Shows: {[x.title for x in self.plan.shows]}") if self.plan.episodes: - print(f"Sync Episodes: {self.plan.episodes}") + print(f"Sync Episodes: {[x.title for x in self.plan.episodes]}") def get_plex_movies(self) -> Generator[PlexLibraryItem, Any, None]: """ From 7a43ccebd8f95b1a7bb99d6c2c31896e4ddf3665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 14 Jan 2023 04:38:25 +0200 Subject: [PATCH 2/3] Use inline title print of library names in info command --- plextraktsync/commands/info.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plextraktsync/commands/info.py b/plextraktsync/commands/info.py index fedb83ec61..15ffa5021c 100644 --- a/plextraktsync/commands/info.py +++ b/plextraktsync/commands/info.py @@ -34,6 +34,5 @@ def info(print=logger.info): if has_plex_token(): plex = factory.plex_api print(f"Plex Server version: {plex.version}, updated at: {plex.updated_at}") - print( - f"Enabled {len(plex.library_sections)} libraries in Plex Server: {plex.library_section_names}" - ) + section_titles = [x.title for x in plex.library_sections.values()] + print(f"Enabled {len(plex.library_sections)} libraries in Plex Server: {section_titles}") From 20182ff6174a97a925b0992dcbb178e7da4e37e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 14 Jan 2023 04:38:43 +0200 Subject: [PATCH 3/3] Drop unused library_section_names, use inline loop --- plextraktsync/plex/PlexApi.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plextraktsync/plex/PlexApi.py b/plextraktsync/plex/PlexApi.py index 25b41f2408..ed03b6c512 100644 --- a/plextraktsync/plex/PlexApi.py +++ b/plextraktsync/plex/PlexApi.py @@ -123,10 +123,6 @@ def library_sections(self) -> Dict[int, PlexLibrarySection]: continue yield section.key, PlexLibrarySection(section, plex=self) - @property - def library_section_names(self): - return [s.title for s in self.library_sections.values()] - @memoize def system_device(self, device_id: int) -> SystemDevice: return self.plex.systemDevice(device_id)