Skip to content

Commit

Permalink
Set default artist IMG if missing
Browse files Browse the repository at this point in the history
Formatting
  • Loading branch information
tehkillerbee committed Feb 28, 2024
1 parent 323f249 commit 92f0556
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tidalapi/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
from tidalapi.page import Page
from tidalapi.session import Session

DEFAULT_ARTIST_IMG = "1e01cdb6-f15d-4d8b-8440-a047976c1cac"


class Artist:
id: Optional[str] = None
Expand Down Expand Up @@ -81,7 +83,10 @@ def parse_artist(self, json_obj: JsonObj) -> "Artist":
self.roles = roles
self.role = roles[0]

# Get artist picture or use default
self.picture = json_obj.get("picture")
if self.picture is None:
self.picture = DEFAULT_ARTIST_IMG

user_date_added = json_obj.get("dateAdded")
self.user_date_added = (
Expand Down

0 comments on commit 92f0556

Please sign in to comment.