Open boostup opened 3 years ago
default playlist was Discover Weekly "37i9dQZEVXcDGlrEgKnU30"
playlist with 100+ tracks : 37i9dQZF1DX32oVqaQE8BM - Chill Out Music
album : http://localhost:3000/#/album/4kwN0SqdqyuOrp7e409uj4
virtualized list for
Track More Icon
: Copy track link to clipboard (React provides Synthetic events for this BTW)
invalid access token
response from Spotify API is return, becomes all much simpler !!
if (process.env.WORDPRESS_AUTH_REFRESH_TOKEN) {
headers[
'Authorization'
] = `Bearer ${process.env.WORDPRESS_AUTH_REFRESH_TOKEN}`
}
page refresh
functionality was triggered by the user
2) check token expiry prior to every Spotify API call. The authWithStoredTokenStart
used to end up setting authState.success
to false, which would redirect the user the login page. Now instead, the backen refresh token should be invoked prior any Spotify API call, to ensure this API does not throw an execption of the frontend app.When an item in the list below is checked, i means the research was done, but has not necessarily been integrated yet into code base.
Playlists
section of sidebar (color, vertical padding, one-line only, [ellipsis materialUI]next
and previous
which is a url I can fetch:hover
for touch screen on scrolling lists. It seems they are sporadically getting stuck.ErrorBoundary
error=true => using a package called react-error-boundary
that wraps ErrorBoundary
, which seems much easier to work with//fields for playlist
id,name,description,images,owner(display_name),primary_color,type,tracks(limit,next,offset,total,items(track(id,name,album(album_type,artists),is_local,is_playable,popularity,duration_ms,explicit,artists)))
//@TODO fields for albums
const scopes = [
"user-read-currently-playing",
"user-read-recently-played",
"user-read-playback-state",
"user-top-read",
"user-modify-playback-state",
];
getNewReleases( getAlbum( getAlbumTracks( getTrack( getTracks( trackIds: string[], getArtist( getArtistAlbums( getArtistTopTracks( getArtistRelatedArtists( getNewReleases(
isFollowingArtists(
followPlaylist(
unfollowPlaylist(
unfollowArtists(
getMyDevices():
getMyCurrentPlaybackState(
getMyCurrentPlayingTrack(
transferMyPlayback(
deviceIds: string[],
// for progress bar:
// - currentplaybackState?.item.duration_ms
// - currentplaybackState?.progress_ms
// currentplaybackState?.repeat_state: track, context, off
// currentplaybackState?.shuffle_state: true, false
// currentplaybackState?.item.type: "track"
// currentplaybackState?.currently_playing_type;
// currentplaybackState?.timestamp;
console.log("IS PLAYING", isPlaying);
console.log("VOLUME PERCENT", volume);
console.log("MUTE STATE", muteButtonState);
console.log("SHUFFLE", shuffle);
console.log("REPEAT", repeat);
console.log("TRACK NAME", currentTrackName);
console.log("ALBUM IMAGE", albumImage);
console.log("ALBUM NAME", albumName);
console.log("ARTISTS", artists);
// => condition to reach bottom in case I need it: `element.scrollHeight - element.scrollTop === element.clientHeight`
togglefollowPlaylist,
isPlaylistFollowedByUser,
const isFollowed = isPlaylistFollowedByUser({
playlistId: id,
userId: user.id,
});
{/* <FavoriteIcon className="playlistToolbar__favorite" fontSize="large" /> */}
<p>{/* {id} * {playlist?.owner.id} * {user.id} */}</p>
import QueuePlayNextIcon from "@material-ui/icons/QueuePlayNext";
import ExitToAppIcon from '@material-ui/icons/ExitToApp';
import ShuffleIcon from "@material-ui/icons/Shuffle";
import RepeatIcon from "@material-ui/icons/Repeat";
import FavoriteBorderIcon from "@material-ui/icons/FavoriteBorder";
// const userId = user?.id;
// const isPlaylistOwner = playlist?.owner.id === userId;
// userId &&
// !isPlaylistOwner &&
// isPlaylistFollowedByUser({ playlistId: id, userId }, dispatch);
{/* <p>
{id} * {playlist?.owner.id} * {userId}
</p> */}
//Toolbar
// isOwner={isPlaylistOwner}
// isPlaylistFollower={}
// toggleFollowPlaylist={}
Bugs
Menu
component backdrop is hiding the whole app UI, and the menu options are bearly legibleMainLayoutPageWrapper
componentbox-sizing: border-box;
on the footer, I can set its witdh to 100%, and this fixes the issue/library
or/home
, basically any route where the component makes an API request will fail if I reload the app using thereload
button of the browser. This is because, as per the JS error in the console, the API did not receive the bearer token along with the request.