Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
pratyush1712 committed May 15, 2024
1 parent 495a433 commit ff0dfd1
Show file tree
Hide file tree
Showing 4 changed files with 2,823 additions and 2,818 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ public/**.json
node_modules
venv
*.yaml
src/utils/songs.json
*.aux
*.fdb_latexmk
*.fls
Expand Down
4 changes: 3 additions & 1 deletion spotify/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def main():
"id": liked_song["track"]["id"],
"artist": liked_song["track"]["artists"][0]["name"],
}
if liked_song["track"]["id"] in song_ids:
continue
song_ids.add(liked_song["track"]["id"])
resp.append(track_info)
except:
Expand All @@ -69,7 +71,7 @@ def main():
track_info["url"] = song
song_ids.add(song.split("/")[-1].split("?")[0])
resp.append(track_info)

print(len(resp))
with open(WEBSITE_PUBLIC_SONGS_PATH + "songs.json", "w+") as f:
json.dump(resp, f)

Expand Down
8 changes: 6 additions & 2 deletions src/components/HomeLayout/PlayList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function PlayList() {

useEffect(() => {
// check if the displayed songs are unique
const ids = displayedSongs.map(song => song.id);
const ids = displayedSongs.map(song => song?.id);
const uniqueIds = [...new Set(ids)];
if (ids.length !== uniqueIds.length) {
console.log(ids);
Expand All @@ -82,6 +82,10 @@ export default function PlayList() {
const songBubbles = useMemo(
() =>
displayedSongs.map((song, index) => {
if (!song || !song.image) {
console.log("Invalid song", song);
return null;
}
return (
<div
key={index}
Expand All @@ -108,7 +112,7 @@ export default function PlayList() {
setHoverIndex(-1);
hoverRef.current = -1;
}}
onClick={() => handleBubbleClick(`https://open.spotify.com/track/${song.id}`)}>
onClick={() => handleBubbleClick(`https://open.spotify.com/track/${song?.id}`)}>
<Image
loading="lazy"
onError={e => (e.currentTarget.src = "/images/default.jpg")}
Expand Down
Loading

1 comment on commit ff0dfd1

@vercel
Copy link

@vercel vercel bot commented on ff0dfd1 May 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.