diff --git a/exportify.js b/exportify.js index 49c16f2..dcc7ed1 100755 --- a/exportify.js +++ b/exportify.js @@ -52,7 +52,7 @@ class PlaylistTable extends React.Component { // fake a playlist-like structure for the liked songs, so it plays well with the rest of the code let liked_songs = {name: "Liked Songs", external_urls: {spotify: "https://open.spotify.com/collection/tracks"}, images:[{url: "liked_songs.jpeg"}], owner: {id: user.id, external_urls: {spotify: user.external_urls.spotify}}, - tracks: {total: library.total, href: "https://api.spotify.com/v1/me/tracks"}, public: false, collaborative: false} + tracks: {total: library.total, href: "https://api.spotify.com/v1/me/tracks"}} let playlists = [[liked_songs]] // double list so .flat() flattens everything right later // Retrieve the list of all the user's playlists by querying the playlists endpoint. @@ -107,27 +107,19 @@ class PlaylistTable extends React.Component { React.createElement("i", { className: "fa fa-fw fa-sort", style: { color: '#C0C0C0' }, id: "sortByOwner", onClick: () => this.sortRows("Owner")} )), React.createElement("th", {style: {minWidth: "100px"}}, "Tracks", React.createElement("i", { className: "fa fa-fw fa-sort", style: { color: '#C0C0C0' }, id: "sortByTracks", onClick: () => this.sortRows("Tracks")} )), - React.createElement("th", null, "Public?"), - React.createElement("th", null, "Collaborative?"), React.createElement("th", { className: "text-right"}, React.createElement("button", { className: "btn btn-default btn-xs", type: "submit", id: "exportAll", onClick: () => PlaylistExporter.exportAll(this.props.access_token, this.state.playlists) }, React.createElement("i", { className: "fa fa-file-archive-o"}), " Export All")))), //table body React.createElement("tbody", null, - this.state.playlists.map((playlist, i) => + this.state.playlists.map((playlist, i) => React.createElement("tr", null, // tr = table row React.createElement("td", null, // td = table data React.createElement("img", { src: playlist.images?.length > 0 ? playlist.images[0].url : "https://placehold.co/30?text=blank", style: { width: "30px", height: "30px" }})), React.createElement("td", null, React.createElement("a", { href: playlist.external_urls.spotify }, playlist.name)), React.createElement("td", null, React.createElement("a", { href: playlist.owner.external_urls.spotify }, playlist.owner.id)), React.createElement("td", null, playlist.tracks.total), - React.createElement("td", null, playlist.public ? - React.createElement("i", { className: "fa fa-lg fa-check-circle-o" }) : - React.createElement("i", { className: "fa fa-lg fa-times-circle-o", style: { color: '#ECEBE8' } })), - React.createElement("td", null, playlist.collaborative ? - React.createElement("i", { className: "fa fa-lg fa-check-circle-o" }) : - React.createElement("i", { className: "fa fa-lg fa-times-circle-o", style: { color: '#ECEBE8' } })), React.createElement("td", { className: "text-right" }, React.createElement("button", { className: "btn btn-default btn-xs btn-success", id: "export" + i, onClick: () => PlaylistExporter.export(this.props.access_token, this.state.playlists[i], i) }, React.createElement("i", { className: "fa fa-download" }) /* download icon */, " Export")))))))