Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xnetcat committed Oct 14, 2024
1 parent 7ca14e6 commit a81eb3f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion spotdl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]:
Expand Down
4 changes: 3 additions & 1 deletion spotdl/console/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 8 additions & 4 deletions spotdl/console/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion spotdl/download/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit a81eb3f

Please sign in to comment.