From a81eb3fd1db7141c80af309ae007f4c8f5f3e0ac Mon Sep 17 00:00:00 2001 From: kuba Date: Mon, 14 Oct 2024 15:38:01 +0300 Subject: [PATCH] fix linter errors --- spotdl/__init__.py | 4 +++- spotdl/console/meta.py | 4 +++- spotdl/console/sync.py | 12 ++++++++---- spotdl/download/downloader.py | 4 +++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/spotdl/__init__.py b/spotdl/__init__.py index 4aa11f263..33f92a197 100644 --- a/spotdl/__init__.py +++ b/spotdl/__init__.py @@ -105,7 +105,9 @@ def search(self, query: List[str]) -> List[Song]: use_ytm_data=self.downloader.settings["ytm_data"], playlist_numbering=self.downloader.settings["playlist_numbering"], album_type=self.downloader.settings["album_type"], - playlist_retain_track_cover=self.downloader.settings["playlist_retain_track_cover"], + playlist_retain_track_cover=self.downloader.settings[ + "playlist_retain_track_cover" + ], ) def get_download_urls(self, songs: List[Song]) -> List[Optional[str]]: diff --git a/spotdl/console/meta.py b/spotdl/console/meta.py index fb4941f98..3a73560dd 100644 --- a/spotdl/console/meta.py +++ b/spotdl/console/meta.py @@ -176,7 +176,9 @@ async def pool_worker(file_path: Path) -> None: use_ytm_data=downloader.settings["ytm_data"], playlist_numbering=downloader.settings["playlist_numbering"], album_type=downloader.settings["album_type"], - playlist_retain_track_cover=downloader.settings["playlist_retain_track_cover"], + playlist_retain_track_cover=downloader.settings[ + "playlist_retain_track_cover" + ], ) downloader.download_multiple_songs(songs_list) diff --git a/spotdl/console/sync.py b/spotdl/console/sync.py index 9d5a3f5f1..1c3128aa6 100644 --- a/spotdl/console/sync.py +++ b/spotdl/console/sync.py @@ -4,8 +4,8 @@ import json import logging -from typing import List, Tuple from pathlib import Path +from typing import List, Tuple from spotdl.download.downloader import Downloader from spotdl.types.song import Song @@ -56,7 +56,9 @@ def sync( use_ytm_data=downloader.settings["ytm_data"], playlist_numbering=downloader.settings["playlist_numbering"], album_type=downloader.settings["album_type"], - playlist_retain_track_cover=downloader.settings["playlist_retain_track_cover"], + playlist_retain_track_cover=downloader.settings[ + "playlist_retain_track_cover" + ], ) # Create sync file @@ -113,7 +115,9 @@ def sync( use_ytm_data=downloader.settings["ytm_data"], playlist_numbering=downloader.settings["playlist_numbering"], album_type=downloader.settings["album_type"], - playlist_retain_track_cover=downloader.settings["playlist_retain_track_cover"], + playlist_retain_track_cover=downloader.settings[ + "playlist_retain_track_cover" + ], ) # Get the names and URLs of previously downloaded songs from the sync file @@ -153,7 +157,7 @@ def sync( if path != new_path: to_rename.append((path, new_path)) - # TODO: Downloading duplicate songs in the same playlist + # fixme Downloading duplicate songs in the same playlist # will trigger a re-download of the song. To fix this we have to copy the song # to the new location without removing the old one. for old_path, new_path in to_rename: diff --git a/spotdl/download/downloader.py b/spotdl/download/downloader.py index 658eddefc..fdf86fb70 100644 --- a/spotdl/download/downloader.py +++ b/spotdl/download/downloader.py @@ -309,7 +309,9 @@ def download_multiple_songs( self.settings["save_errors"], "a", encoding="utf-8" ) as error_file: if len(self.errors) > 0: - error_file.write(f"{datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}\n") + error_file.write( + f"{datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}\n" + ) for error in self.errors: error_file.write(f"{error}\n")