Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Syncing Between Music Video & Player, Decrease Network Bandwidth & Transfer, Repetitive Authentication and Styled Components #150

Merged
merged 55 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f4d38b0
Feat(package.json): Compile with Turbopack (--turbo)
WillKirkmanM Nov 25, 2024
d68f99b
Feat(AlbumComponent.tsx): Use Aspect Ratio for Album Covers
WillKirkmanM Nov 25, 2024
e789d0f
Fix(history/page): Type Errors
WillKirkmanM Nov 25, 2024
b2aad72
Fix(home/page): Config not Updating & Being Reset on Page Load
WillKirkmanM Nov 25, 2024
7d2d5b6
Feat(PlaylistComponent): Extend LibrarySong Type to add date_added pr…
WillKirkmanM Nov 25, 2024
857b389
Feat(SearchComponent.tsx): Move Search Results to the Center
WillKirkmanM Nov 25, 2024
88061d8
Feat(social/page): Use ProfilePicture instead of User Acronym
WillKirkmanM Nov 25, 2024
5186a9d
Feat((unprotected/page)): BETA Standalone App Handling
WillKirkmanM Nov 25, 2024
87f6426
Fix(SongsInLibrary.tsx): Type Errors
WillKirkmanM Nov 25, 2024
c042674
Fix(FriendActivity.tsx): Type Errors
WillKirkmanM Nov 25, 2024
c30ebe6
Fix(FromYourLibrary.tsx): Fix Type Errors by Coercing to LibrarySong
WillKirkmanM Nov 25, 2024
d9786e3
Fix(FromYourLibrary.tsx): Fix Type Errors by Coercing to ListenAgainSong
WillKirkmanM Nov 25, 2024
8066503
Fix(FromYourLibrary.tsx): Fix Type Errors by Coercing to LibrarySong
WillKirkmanM Nov 25, 2024
9582b44
Fix(FromYourLibrary.tsx): Fix Type Errors by Coercing to LibrarySong
WillKirkmanM Nov 25, 2024
538cc2e
Feat(Sidebar): Just close it on a smaller screen
WillKirkmanM Nov 25, 2024
16dd42c
Feat(EditSongDialog): Add component for metadata management
WillKirkmanM Nov 25, 2024
53f4ba0
Feat(Player): Refactor component imports and cleanup
WillKirkmanM Nov 25, 2024
ff21d14
Feat(SongContextMenu): Enhance song context menu dialog and error han…
WillKirkmanM Nov 25, 2024
2e6324a
Feat(AlbumTable): Add Hover Effects to Cards
WillKirkmanM Nov 25, 2024
d35868d
Fix(HorizontalCard.tsx): Fix Type Errors by Coercing to LibrarySong
WillKirkmanM Nov 25, 2024
3f8e560
Feat(MusicVideoCard): Add modal video player to music video cards
WillKirkmanM Nov 25, 2024
15d28c6
FeatSongCard): Add Song Card Player Indicators
WillKirkmanM Nov 25, 2024
12a130e
Feat(TopResultsCard): Add Blur & Playing Effects
WillKirkmanM Nov 25, 2024
774d05f
Fix(usePlayer.tsx): Fix Type Errors by Coercing to LibrarySong
WillKirkmanM Nov 25, 2024
3b41540
Fix(VideoPlayerDialog.tsx): Fix Type Errors by Coercing to LibrarySong
WillKirkmanM Nov 25, 2024
9335e45
Fix(LayoutConfigContext): Fix Layout Changing
WillKirkmanM Nov 25, 2024
e1ca518
Feat(ProfilePicture): Extract to Separate Profile Picture Component
WillKirkmanM Nov 25, 2024
3317fae
Feat(FromYourLibrary.tsx): Remove Hidden & Decrease
WillKirkmanM Nov 25, 2024
afcb925
Feat(LandingCarousel.tsx): Remove Hidden
WillKirkmanM Nov 25, 2024
f018ae7
Feat(ListenAgain): Decrease Padding Between Elements
WillKirkmanM Nov 25, 2024
a7409fe
Feat(RandomSongs): Decrease Padding Between Elements
WillKirkmanM Nov 25, 2024
748d65c
Feat(RecommendedAlbums): Decrease Padding Between Elements
WillKirkmanM Nov 25, 2024
6d4f93d
Feat(SimilarTo): Decrease Padding Between Elements
WillKirkmanM Nov 25, 2024
63f1634
Feat(Player): Check if contributing artist ids are defined before map…
WillKirkmanM Nov 25, 2024
750d597
Feat(AlbumTable): Align Play / Pause Icons to Cover Track Numbers
WillKirkmanM Nov 25, 2024
b299511
Feat(SongCard): Dim Card on Now Playing
WillKirkmanM Nov 25, 2024
5ed270b
Feat(AlbumCard): Change Colour of Track Amount
WillKirkmanM Nov 25, 2024
50aeb3b
Fix(VideoPlayerDialog): Time Syncing between Player & Video
WillKirkmanM Nov 25, 2024
9d0758e
Feat(main.rs): Use music::
WillKirkmanM Nov 25, 2024
6913cde
Feat(album.rs): Album Metadata & Adding & Deleting Routes
WillKirkmanM Nov 25, 2024
192e316
Feat(artist.rs): Editing Metadata, Adding & Deleting new Artists
WillKirkmanM Nov 25, 2024
9928c7c
Feat(authentication.rs): Import std::env
WillKirkmanM Nov 25, 2024
f1b27b2
Feat(music.rs): Just &*&mut
WillKirkmanM Nov 25, 2024
acf5405
Feat(music.rs): Just &*&mut
WillKirkmanM Nov 25, 2024
8f91892
Feat(search.rs): Use Bare Song Information when Searching
WillKirkmanM Nov 25, 2024
b20d785
Feat(song.rs): Editing Metadata, Adding & Deleting Songs
WillKirkmanM Nov 25, 2024
6b24a06
Feat(config.rs): Add library caching and save functionality
WillKirkmanM Nov 25, 2024
c0dae59
Feat(album.ts): Add Bare & Full Types
WillKirkmanM Nov 25, 2024
b1771e9
Feat(artist.ts): Add Creating, Updating & Deleting Route Functions
WillKirkmanM Nov 25, 2024
f05ae88
Feat(song.ts): Add Creating, Updating & Deleting Route Functions
WillKirkmanM Nov 25, 2024
2fd4126
Feat(types.ts): Add BareSong type
WillKirkmanM Nov 25, 2024
6e94a31
Feat(web.ts): Extract into ListenAgainSong type
WillKirkmanM Nov 25, 2024
9696d10
PKG(package.json): Add Aspect Ratio from Radix UI
WillKirkmanM Nov 25, 2024
ec395f1
Feat(aspect-ratio.tsx): Highly Complex Component Declaration
WillKirkmanM Nov 25, 2024
41d08fb
Feat(table.tsx): Remove Hover Background
WillKirkmanM Nov 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions apps/web/app/(app)/album/AlbumComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import WikidataLogo from "@/public/wikidata_logo.png";
import WikipediaLogo from "@/public/wikipedia_logo.png";
import { getAlbumInfo, getArtistInfo, LibraryAlbum } from "@music/sdk";
import { Artist } from "@music/sdk/types";
import { AspectRatio } from "@music/ui/components/aspect-ratio";
import { Badge } from "@music/ui/components/badge";
import { Button } from "@music/ui/components/button";
import { ScrollArea, ScrollBar } from "@music/ui/components/scroll-area";
Expand All @@ -34,20 +35,26 @@ export default function AlbumComponent() {
if (!id || typeof id !== "string") return;

const fetchAlbumInfo = async () => {
const album = await getAlbumInfo(id);
const album = await getAlbumInfo(id) as LibraryAlbum;

const artistData = album.artist_object;
const contributingArtistIds = album.contributing_artists_ids;

const contributingArtistsPromises = contributingArtistIds.map((artistId) =>
getArtistInfo(artistId)
);

const contributingArtistsData = await Promise.all(contributingArtistsPromises);

if (contributingArtistIds) {
const contributingArtistsPromises = contributingArtistIds.map((artistId) =>
getArtistInfo(artistId)
);

const contributingArtistsData = await Promise.all(contributingArtistsPromises);
setContributingArtists(contributingArtistsData);
} else {
setContributingArtists([])
}

setAlbum(album);
setArtist(artistData);
setContributingArtists(contributingArtistsData);

// setContributingArtists(contributingArtistsData);
};

fetchAlbumInfo();
Expand Down Expand Up @@ -109,14 +116,15 @@ export default function AlbumComponent() {
<PageGradient imageSrc={albumCoverURL} />
<div className="flex flex-col md:flex-row items-start my-8">
<ScrollArea className="flex flex-col items-center w-full md:w-1/4 h-full">
<div className="flex-shrink-0 w-72 h-72 mx-auto">
<Image
src={albumCoverURL}
alt={`${album.name} Image`}
height={400}
width={400}
className="w-full h-full object-fill rounded"
/>
<div className="flex-shrink-0 w-full max-w-xs mx-auto">
<div className="relative" style={{ paddingBottom: '100%' }}>
<Image
src={albumCoverURL}
alt={`${album.name} Image`}
layout="fill"
className="absolute top-0 left-0 w-full h-full object-cover rounded"
/>
</div>
</div>
<div className="md:pl-4 flex-grow text-center mt-4">
<h1 className="text-4xl">{album.name}</h1>
Expand All @@ -129,7 +137,7 @@ export default function AlbumComponent() {
height={20}
alt={`${artist.name} Profile Picture`}
className="rounded-full"
/>
/>
<p className="text-xs text-gray-200 ml-2">
{album.release_group_album?.artist_credit.map((artist) => (
<span key={artist.musicbrainz_id}>{artist.name}</span>
Expand Down Expand Up @@ -298,7 +306,7 @@ export default function AlbumComponent() {
<Description description={album.description}/>
<div className="grid grid-cols-1 gap-4 mt-4">
{contributingArtists.map(artist => (
<Link href={`/artist/${artist.id}`} key={artist.id}>
<Link href={`/artist/?id=${artist.id}`} key={artist.id}>
<div key={artist.id} className="flex items-center">
<Image
src={artist.icon_url.length === 0 ? "/snf.png" : `${getBaseURL()}/image/${encodeURIComponent(artist.icon_url)}`}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/(app)/history/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function HistoryPage() {
if (session) {
const listenHistoryItems = await getListenHistory(Number(session.sub));
const songDetailsPromises = listenHistoryItems.reverse().map(item => getSongInfo(item.song_id));
const songDetails = await Promise.all(songDetailsPromises);
const songDetails = await Promise.all(songDetailsPromises) as LibrarySong[];

setListenHistorySongs(songDetails);
}
Expand Down
10 changes: 9 additions & 1 deletion apps/web/app/(app)/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export default function Home() {
useEffect(() => {
const savedConfig = localStorage.getItem("layoutConfig");
if (savedConfig) {
setComponents(JSON.parse(savedConfig));
const parsedConfig = JSON.parse(savedConfig);
setComponents(parsedConfig);
} else {
}
}, [setComponents]);

Expand All @@ -57,6 +59,12 @@ export default function Home() {
};
}, []);

useEffect(() => {
if (components && components.length > 0) {
localStorage.setItem("layoutConfig", JSON.stringify(components));
}
}, [components]);

type ComponentConfig = {
id: string;
name: string;
Expand Down
6 changes: 4 additions & 2 deletions apps/web/app/(app)/playlist/PlaylistComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ interface Playlist extends OriginalPlaylist {
updatedAt: Date;
}

type LibrarySongWithDate = LibrarySong & { date_added: string }

export default function PlaylistComponent() {
const searchParams = useSearchParams();
const id = searchParams?.get("id");

const [playlist, setPlaylist] = useState<Playlist | null>(null);
const [songsWithMetadata, setSongsWithMetadata] = useState<(LibrarySong & { date_added: string })[]>([]);
const [songsWithMetadata, setSongsWithMetadata] = useState<(LibrarySongWithDate)[]>([]);
const [totalDuration, setTotalDuration] = useState<number>(0);

useEffect(() => {
Expand All @@ -45,7 +47,7 @@ export default function PlaylistComponent() {
return { ...songData, date_added: songInfo.date_added };
});

const songsWithMetadataData = await Promise.all(songsWithMetadataPromises);
const songsWithMetadataData = await Promise.all(songsWithMetadataPromises) as unknown as LibrarySongWithDate[];
setSongsWithMetadata(songsWithMetadataData);

const totalDuration = songsWithMetadataData.reduce((total: number, song: LibrarySong & { date_added: string }) => total + song.duration, 0);
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/(app)/search/SearchComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function SearchComponent() {
}, [query]);

return (
<div className="flex items-center justify-start overflow-y-hidden h-full min-h-screen pt-32 pl-20 pb-20">
<div className="flex items-center justify-center overflow-y-hidden h-full min-h-screen pt-32 pl-20 pb-20 scale-110">
<div className="transform scale-110 pt-20 pb-20">
{suggestion && suggestion.toLowerCase() !== query.toLowerCase() && (
<p className="text-sm text-white mt-6">
Expand Down
7 changes: 2 additions & 5 deletions apps/web/app/(app)/social/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ArtistCard from "@/components/Music/Artist/ArtistCard";
import { User } from "@music/sdk/types";
import UserCard from "@/components/Music/Card/User/UserCard";
import { useSession } from "@/components/Providers/AuthProvider";
import ProfilePicture from "@/components/User/ProfilePicture";

export default function SocialPage() {
const { session } = useSession()
Expand Down Expand Up @@ -58,11 +59,7 @@ export default function SocialPage() {
{userInfo.image ? (
<Image src={userInfo.image} alt="" className="w-32 h-32 rounded-full" />
) : (
<Avatar className="w-32 h-32">
<AvatarFallback className="text-4xl">
{userInfo.username.substring(0, 2).toUpperCase()}
</AvatarFallback>
</Avatar>
<ProfilePicture />
)}
<div className="flex flex-col">
<p className="text-lg">@{userInfo.username}</p>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/app/(unprotected)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export default function MainPage() {
const { session } = useSession()

useEffect(() => {
if (process.env.LOCAL_APP) push("/home")

const checkServerUrl = async () => {
setLoading(true);

Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/Artist/SongsInLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function getSongsFromYourLibrary(user_id: number, artist_id: string) {

const songsDetailsPromises = playlistSongIDs.map((songID) => getSongInfo(String(songID)));

const songsDetails = await Promise.all(songsDetailsPromises);
const songsDetails = await Promise.all(songsDetailsPromises) as LibrarySong[];

const filteredSongsDetails = songsDetails.filter(song => String(song.artist_object.id) === artist_id);

Expand Down
4 changes: 2 additions & 2 deletions apps/web/components/Friends/FriendActivity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import getSession from "@/lib/Authentication/JWT/getSession";
import { getFollowing, getNowPlaying, getSongInfo, getUserInfoById } from "@music/sdk";
import { Album, Artist, LibrarySong as Song, User } from "@music/sdk/types";
import { Album, Artist, LibrarySong, LibrarySong as Song, User } from "@music/sdk/types";
import { Avatar, AvatarFallback, AvatarImage } from "@music/ui/components/avatar";
import { Disc3Icon } from 'lucide-react';
import Link from "next/link";
Expand Down Expand Up @@ -34,7 +34,7 @@ export default function FriendActivity() {
const profilePicture = profilePicBlob ? URL.createObjectURL(profilePicBlob) : null;

if (nowPlayingSongID) {
const songResponse = await getSongInfo(String(nowPlayingSongID.now_playing) ?? 0);
const songResponse = await getSongInfo(String(nowPlayingSongID.now_playing) ?? 0) as LibrarySong;
return {
...friend,
nowPlaying: {
Expand Down
7 changes: 3 additions & 4 deletions apps/web/components/Home/FromYourLibrary.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"use client"

import getSession from "@/lib/Authentication/JWT/getSession";
import setCache, { getCache } from "@/lib/Caching/cache";
import { getPlaylist, getPlaylists, getSongInfo } from "@music/sdk";
import { LibrarySong } from "@music/sdk/types";
import { useEffect, useState } from "react";
import SongCard from "../Music/Card/SongCard";
import ScrollButtons from "./ScrollButtons";
import { useSession } from "../Providers/AuthProvider";
import ScrollButtons from "./ScrollButtons";

async function getSongsFromYourLibrary(user_id: number, genre?: string) {
const playlists = await getPlaylists(user_id);
Expand All @@ -22,7 +21,7 @@ async function getSongsFromYourLibrary(user_id: number, genre?: string) {

const songsDetailsPromises = playlistSongIDs.map((songID) => getSongInfo(String(songID)));

const songsDetails = await Promise.all(songsDetailsPromises);
const songsDetails = await Promise.all(songsDetailsPromises) as LibrarySong[];

if (genre) {
return songsDetails.filter(song => {
Expand Down Expand Up @@ -73,7 +72,7 @@ export default function FromYourLibrary({ genre }: FromYourLibraryProps) {
``
return (
<ScrollButtons heading="From Your Library" id="FromYourLibrary">
<div className="flex flex-row pb-28">
<div className="flex flex-row pb-14">
{librarySongs.map((song, index) => (
<div className="mr-20" key={index}>
<SongCard album_cover={song.album_object.cover_url} album_id={song.album_object.id} album_name={song.album_object.name} artist_id={song.artist_object.id} artist_name={song.artist} path={song.path} song_id={song.id} song_name={song.name} />
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/Home/LandingCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default function LandingCarousel() {
const albumCoverURL = `${getBaseURL()}/image/${encodeURIComponent(album.cover_url)}?raw=true`;

return (
<div className="relative p-5 flex items-center hidden md:flex" style={{ height: '300px' }}>
<div className="relative p-5 flex items-center md:flex" style={{ height: '300px' }}>
<Image
className="absolute top-0 left-0 w-full h-full bg-cover bg-center blur-2xl brightness-50"
alt={`${album.name} Album Background Image`}
Expand Down
8 changes: 4 additions & 4 deletions apps/web/components/Home/ListenAgain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import getSession from "@/lib/Authentication/JWT/getSession";
import setCache, { getCache } from "@/lib/Caching/cache";
import getBaseURL from "@/lib/Server/getBaseURL";
import { getListenAgain, SongInfo } from "@music/sdk";
import { getListenAgain, ListenAgainSong, SongInfo } from "@music/sdk";
import { useEffect, useState } from "react";
import PageGradient from "../Layout/PageGradient";
import AlbumCard from "../Music/Card/Album/AlbumCard";
Expand All @@ -16,12 +16,12 @@ interface ListenAgainProps {
}

export default function ListenAgain({ genre }: ListenAgainProps) {
const [listenHistorySongs, setListenHistorySongs] = useState<SongInfo[]>([]);
const [listenHistorySongs, setListenHistorySongs] = useState<ListenAgainSong[]>([]);
const { session } = useSession()

useEffect(() => {
const fetchListenHistory = async () => {
const listenHistory = await getListenAgain(Number(session?.sub));
const listenHistory = await getListenAgain(Number(session?.sub)) as ListenAgainSong[];
setListenHistorySongs(listenHistory);
};

Expand All @@ -38,7 +38,7 @@ export default function ListenAgain({ genre }: ListenAgainProps) {
<>
<PageGradient imageSrc={albumCoverSrc} />
<ScrollButtons heading="Listen Again" showUser id="ListenAgain">
<div className="flex flex-row pb-28">
<div className="flex flex-row pb-14">
{listenHistorySongs.map((item, index) => {
if (item.item_type === "album") {
return (
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/Home/RandomSongs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function RandomSongs({ genre }: RandomSongsProps) {

return (
<ScrollButtons heading="Random Selection" id="RandomSongs">
<div className="flex flex-row pb-28">
<div className="flex flex-row pb-14">
{randomSongs.map((song, index) => (
<div className="mr-20" key={index}>
<SongCard album_cover={song.album_object.cover_url} album_id={song.album_object.id} album_name={song.album_object.name} artist_id={song.artist_object.id} artist_name={song.artist} path={song.path} song_id={song.id} song_name={song.name} />
Expand Down
9 changes: 4 additions & 5 deletions apps/web/components/Home/RecommendedAlbums.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"use client"

import getSession from "@/lib/Authentication/JWT/getSession";
import setCache, { getCache } from "@/lib/Caching/cache";
import { getPlaylist, getPlaylists, getSongInfo } from "@music/sdk";
import { LibrarySong } from "@music/sdk/types";
import { useEffect, useState } from "react";
import AlbumCard from "../Music/Card/Album/AlbumCard";
import ScrollButtons from "./ScrollButtons";
import { LibrarySong } from "@music/sdk/types";
import { useSession } from "../Providers/AuthProvider";
import ScrollButtons from "./ScrollButtons";

async function getSongsFromYourLibrary(user_id: number, genre?: string) {
const playlists = await getPlaylists(user_id);
Expand All @@ -22,7 +21,7 @@ async function getSongsFromYourLibrary(user_id: number, genre?: string) {

const songsDetailsPromises = playlistSongIDs.map((songID) => getSongInfo(String(songID)));

const songsDetails = await Promise.all(songsDetailsPromises);
const songsDetails = await Promise.all(songsDetailsPromises) as unknown as LibrarySong[];

if (genre) {
return songsDetails.filter(song => {
Expand Down Expand Up @@ -73,7 +72,7 @@ export default function RecommendedAlbums({ genre }: RecommendedAlbumsProps) {

return (
<ScrollButtons heading="Recommended Albums" id="RecommendedAlbums">
<div className="flex flex-row pb-28">
<div className="flex flex-row pb-14">
{librarySongs.map((song, index) => (
<div className="mr-20" key={index}>
<AlbumCard
Expand Down
10 changes: 4 additions & 6 deletions apps/web/components/Home/SimilarTo.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
"use client";

import getSession from "@/lib/Authentication/JWT/getSession";
import getBaseURL from "@/lib/Server/getBaseURL";
import { getSimilarTo, AlbumCardProps } from "@music/sdk";
import { AlbumCardProps, getSimilarTo } from "@music/sdk";
import { useEffect, useState } from "react";
import PageGradient from "../Layout/PageGradient";
import AlbumCard from "../Music/Card/Album/AlbumCard";
import ScrollButtons from "./ScrollButtons";
import { Skeleton } from "@music/ui/components/skeleton";
import { useSession } from "../Providers/AuthProvider";
import ScrollButtons from "./ScrollButtons";

function capitalizeWords(str: string): string {
return str.replace(/\b\w/g, char => char.toUpperCase());
Expand Down Expand Up @@ -48,9 +46,9 @@ export default function SimilarTo() {
<PageGradient imageSrc={albumCoverSrc} />
<ScrollButtons heading={capitalizeWords(genre ?? "")} topText="SIMILAR TO" imageUrl={albumCoverSrc} id="SimilarTo">
<div className="w-full h-full">
<div className="grid grid-flow-col grid-rows-2 gap-2 w-full h-full">
<div className="grid grid-flow-col grid-rows-2 gap-2 w-full h-full pb-8">
{similarAlbums.map((album, index) => (
<div className="w-48 h-full pb-28 scale-90" key={index}>
<div className="w-48 h-full pb-14 scale-90" key={index}>
<AlbumCard
artist_id={album.artist_id}
artist_name={album.artist_name}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/Layout/LibraryButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function LibraryButtons() {
const listenHistoryItems = await getListenHistory(userId);
const uniqueListenHistoryItems = Array.from(new Set(listenHistoryItems.map(item => item.song_id)));
const songDetailsPromises = uniqueListenHistoryItems.reverse().slice(0, 30).map(song_id => getSongInfo(song_id));
const songDetails = await Promise.all(songDetailsPromises);
const songDetails = await Promise.all(songDetailsPromises) as unknown as LibrarySong[];

setListenHistorySongs(songDetails);
setCache(cacheKey, songDetails, 3600000);
Expand Down
2 changes: 0 additions & 2 deletions apps/web/components/Layout/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export default function Sidebar({ children, sidebarContent }: SidebarProps) {
const handleResize = () => {
if (window.innerWidth < 768) {
closeSidebar();
} else {
openSidebar();
}
};

Expand Down
Loading
Loading