Skip to content

Commit

Permalink
Refactor Spotify API pictureURL fallback to use placeholder image
Browse files Browse the repository at this point in the history
  • Loading branch information
KinanLak committed Oct 21, 2024
1 parent dce9fbc commit 9aa6e38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ts/api/Spotify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class Spotify {
country: body.country,
followers: body.followers.total,
spotifyPlan: body.product,
pictureURL: new URL(body.images[0].url),
pictureURL: body.images.length > 0 ? new URL(body.images[0].url) : new URL("https://placekitten.com/300/300"),
userURL: new URL(body.external_urls.spotify),

topArtists: [],
Expand Down

0 comments on commit 9aa6e38

Please sign in to comment.