Skip to content

Commit 519d6a1

Browse files
committed
added photo for liked songs
1 parent 61563a5 commit 519d6a1

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

exportify.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ class PlaylistTable extends React.Component {
5252

5353
// fake a playlist-like structure for the liked songs, so it plays well with the rest of the code
5454
let liked_songs = {name: "Liked Songs", external_urls: {spotify: "https://open.spotify.com/collection/tracks"},
55-
images:[{url: "https://placehold.co/30?text=blank"}],
56-
owner: {id: user.id, external_urls: {spotify: user.external_urls.spotify}}, tracks: {total: library.total,
57-
href: "https://api.spotify.com/v1/me/tracks"}, public: false, collaborative: false}
55+
images:[{url: "liked_songs.jpeg"}], owner: {id: user.id, external_urls: {spotify: user.external_urls.spotify}},
56+
tracks: {total: library.total, href: "https://api.spotify.com/v1/me/tracks"}, public: false, collaborative: false}
5857
let playlists = [[liked_songs]] // double list so .flat() flattens everything right later
5958

6059
// Retrieve the list of all the user's playlists by querying the playlists endpoint.
@@ -119,10 +118,8 @@ class PlaylistTable extends React.Component {
119118
React.createElement("tbody", null,
120119
this.state.playlists.map((playlist, i) =>
121120
React.createElement("tr", null, // tr = table row
122-
React.createElement("td", null, playlist.name == "Liked Songs" ? // td = table data
123-
React.createElement("i", { className: "fa fa-heart", style: { color: "#3A30CF" } }):
124-
React.createElement("img", { src: playlist.images && playlist.images.length > 0 ? playlist.images[0].url : "https://placehold.co/30?text=blank" , style: { width: "30px", height: "30px" }})),
125-
//React.createElement("i", { className: "fa fa-music" })),
121+
React.createElement("td", null, // td = table data
122+
React.createElement("img", { src: playlist.images?.length > 0 ? playlist.images[0].url : "https://placehold.co/30?text=blank", style: { width: "30px", height: "30px" }})),
126123
React.createElement("td", null, React.createElement("a", { href: playlist.external_urls.spotify }, playlist.name)),
127124
React.createElement("td", null, React.createElement("a", { href: playlist.owner.external_urls.spotify }, playlist.owner.id)),
128125
React.createElement("td", null, playlist.tracks.total),

liked_songs.jpeg

8.27 KB
Loading

0 commit comments

Comments
 (0)