Skip to content

Commit

Permalink
made album type optional
Browse files Browse the repository at this point in the history
  • Loading branch information
xnetcat committed Nov 14, 2024
1 parent 58b25d9 commit 49a177c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spotdl/types/song.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Song:
disc_count: int
album_name: str
album_artist: str
album_type: str
duration: int
year: int
date: str
Expand All @@ -61,6 +60,7 @@ class Song:
list_position: Optional[int] = None
list_length: Optional[int] = None
artist_id: Optional[str] = None
album_type: Optional[str] = None

@classmethod
def from_url(cls, url: str) -> "Song":
Expand Down Expand Up @@ -108,7 +108,7 @@ def from_url(cls, url: str) -> "Song":
album_id=album_id,
album_name=raw_album_meta["name"],
album_artist=raw_album_meta["artists"][0]["name"],
album_type=raw_album_meta["album_type"],
album_type=raw_album_meta.get("album_type"),
copyright_text=(
raw_album_meta["copyrights"][0]["text"]
if raw_album_meta["copyrights"]
Expand Down

0 comments on commit 49a177c

Please sign in to comment.