Skip to content

Commit

Permalink
black/isort
Browse files Browse the repository at this point in the history
  • Loading branch information
xnetcat committed Sep 1, 2023
1 parent 06f1e9e commit b39572b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions spotdl/types/song.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from dataclasses import asdict, dataclass
from typing import Any, Dict, List, Optional, Tuple

from spotdl.utils.spotify import SpotifyClient
from rapidfuzz import fuzz

from spotdl.utils.spotify import SpotifyClient

__all__ = ["Song", "SongList", "SongError"]


Expand Down Expand Up @@ -331,7 +332,7 @@ def from_search_term(cls, search_term: str, fetch_songs: bool = True):
score = fuzz.ratio(search_term.split(":", 1)[1].strip(), result["name"])
matches[result["id"]] = score

best_match = max(matches, key=matches.get) # type: ignore
best_match = max(matches, key=matches.get) # type: ignore

return cls.from_url(
f"http://open.spotify.com/{list_type}/{best_match}",
Expand Down
2 changes: 1 addition & 1 deletion spotdl/utils/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def restrict_filename(pathobj: Path, strict: bool = True) -> Path:
- Based on the `sanitize_filename` function from yt-dlp
"""
if strict:
result = sanitize_filename(pathobj.name, True, False) # type: ignore
result = sanitize_filename(pathobj.name, True, False) # type: ignore
result = result.replace("_-_", "-")
else:
result = (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
"https://open.spotify.com/track/5CfVW6OUB6Uh9X6XVpdNYE",
["https://music.youtube.com/watch?v=tfTOTXOlplY"],
),
(
# (
# # Loud Luxury - Body (Dzeko Remix)
# "https://open.spotify.com/track/3ATwxbyPDsZWvlBdnyKNPQ",
# [
Expand Down

0 comments on commit b39572b

Please sign in to comment.