diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 650f8dff96e..910114e11ef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: destroyed-symlinks - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.9 + rev: v0.9.7 hooks: - id: ruff args: [ --fix ] diff --git a/plextraktsync/__main__.py b/plextraktsync/__main__.py index 8702c0a8a51..41ccb6c88eb 100644 --- a/plextraktsync/__main__.py +++ b/plextraktsync/__main__.py @@ -9,7 +9,7 @@ The '__main__' module does not seem to have been run in the context of a runnable package ... did you forget to add the '-m' flag? -Usage: {sys.executable} -m plextraktsync {' '.join(sys.argv[1:])} +Usage: {sys.executable} -m plextraktsync {" ".join(sys.argv[1:])} """ ) diff --git a/plextraktsync/plex/PlexId.py b/plextraktsync/plex/PlexId.py index 991f3baa3b8..d43da9d675b 100644 --- a/plextraktsync/plex/PlexId.py +++ b/plextraktsync/plex/PlexId.py @@ -34,4 +34,4 @@ def __repr__(self): keys = [self.__class__.__name__, self.server, self.provider, self.key] fields = map(str, filter(None, keys)) - return f'<{":".join(fields)}>' + return f"<{':'.join(fields)}>" diff --git a/plextraktsync/plex/PlexPlaylist.py b/plextraktsync/plex/PlexPlaylist.py index 7939797522d..ce2f2727486 100644 --- a/plextraktsync/plex/PlexPlaylist.py +++ b/plextraktsync/plex/PlexPlaylist.py @@ -38,8 +38,7 @@ def playlist(self) -> Playlist | None: playlist: Playlist = playlists[0] if len(playlists) > 1: self.logger.warning( - f"Found multiple playlists ({len(playlists)}) with same name: '{self.name}', " - f"Using first playlist with id {playlist.ratingKey}" + f"Found multiple playlists ({len(playlists)}) with same name: '{self.name}', Using first playlist with id {playlist.ratingKey}" ) self.logger.debug(f"Loaded plex list: '{self.name}'") return playlist diff --git a/plextraktsync/rich/RichProgressBar.py b/plextraktsync/rich/RichProgressBar.py index aacc57fc555..e028b9bd6cb 100644 --- a/plextraktsync/rich/RichProgressBar.py +++ b/plextraktsync/rich/RichProgressBar.py @@ -73,7 +73,7 @@ def progress(self): from tqdm.rich import FractionColumn, RateColumn args = ( - "[progress.description]{task.description}" "[progress.percentage]{task.percentage:>4.0f}%", + "[progress.description]{task.description}[progress.percentage]{task.percentage:>4.0f}%", BarColumn(bar_width=None), FractionColumn( unit_scale=False, diff --git a/plextraktsync/sync/LikedListsPlugin.py b/plextraktsync/sync/LikedListsPlugin.py index 19c5cc1a3e6..0f89ae49e4c 100644 --- a/plextraktsync/sync/LikedListsPlugin.py +++ b/plextraktsync/sync/LikedListsPlugin.py @@ -28,7 +28,7 @@ def factory(cls, sync: Sync): @hookimpl def init(self, sync: Sync, is_partial: bool, dry_run: bool): if is_partial or dry_run: - self.logger.warning("Partial walk, disabling liked lists updating. " "Liked lists won't update because it needs full library sync.") + self.logger.warning("Partial walk, disabling liked lists updating. Liked lists won't update because it needs full library sync.") if is_partial: return diff --git a/plextraktsync/sync/WatchListPlugin.py b/plextraktsync/sync/WatchListPlugin.py index e33d3cfce66..318c70d0a74 100644 --- a/plextraktsync/sync/WatchListPlugin.py +++ b/plextraktsync/sync/WatchListPlugin.py @@ -40,7 +40,7 @@ def init(self, sync: Sync, is_partial: bool): return if is_partial: - self.logger.warning("Running partial library sync. " "Watchlist as playlist won't update because it needs full library sync.") + self.logger.warning("Running partial library sync. Watchlist as playlist won't update because it needs full library sync.") else: sync.trakt_lists.add_watchlist(self.trakt.watchlist_movies) @@ -51,7 +51,7 @@ async def fini(self, walker: Walker, dry_run: bool): await self.sync_watchlist(walker, dry_run=dry_run) if self.config.update_plex_wl_as_pl and dry_run: - self.logger.warning("Running partial library sync. " "Liked lists won't update because it needs full library sync.") + self.logger.warning("Running partial library sync. Liked lists won't update because it needs full library sync.") @cached_property def plex_wl(self): diff --git a/plextraktsync/trakt/TraktLookup.py b/plextraktsync/trakt/TraktLookup.py index abc9a979049..ee8d7cb685b 100644 --- a/plextraktsync/trakt/TraktLookup.py +++ b/plextraktsync/trakt/TraktLookup.py @@ -6,7 +6,7 @@ from plextraktsync.decorators.retry import retry from plextraktsync.factory import logging -EPISODES_ORDERING_WARNING = "episodes ordering is different in Plex and Trakt. " "Check your Plex media source, TMDB is recommended." +EPISODES_ORDERING_WARNING = "episodes ordering is different in Plex and Trakt. Check your Plex media source, TMDB is recommended." if TYPE_CHECKING: from trakt.tv import TVEpisode, TVShow diff --git a/plextraktsync/util/Version.py b/plextraktsync/util/Version.py index 31f81244f81..5f5d8b99536 100644 --- a/plextraktsync/util/Version.py +++ b/plextraktsync/util/Version.py @@ -21,7 +21,7 @@ def full_version(self): # Print version from pip if self.pipx_installed: v = self.vcs_info - return f'{__version__[0:-4]}@pr/{v["pr"]}#{v["short_commit_id"]}' + return f"{__version__[0:-4]}@pr/{v['pr']}#{v['short_commit_id']}" # If installed with Git gv = self.git_version_info