diff --git a/.env.local b/.env.local index 50e8ac4..28a27b0 100644 --- a/.env.local +++ b/.env.local @@ -1 +1 @@ -NEXT_PUBLIC_COMMIT_SHA=88c31c5 +NEXT_PUBLIC_COMMIT_SHA=f1957c7 diff --git a/app/album/[id]/page.tsx b/app/album/[id]/page.tsx index bbe5adc..34f1f1a 100644 --- a/app/album/[id]/page.tsx +++ b/app/album/[id]/page.tsx @@ -4,7 +4,7 @@ import { useParams } from 'next/navigation'; import Image from 'next/image'; import { Album, Song } from '@/lib/navidrome'; import { useNavidrome } from '@/app/components/NavidromeContext'; -import { Play, Heart } from 'lucide-react'; +import { Play, Heart, Shuffle } from 'lucide-react'; import { Button } from '@/components/ui/button'; import Link from 'next/link'; import { useAudioPlayer } from '@/app/components/AudioPlayerContext' @@ -111,6 +111,19 @@ export default function AlbumPage() { } }; + const handleShuffleAlbum = async (): Promise => { + if (!album || !tracklist.length) return; + + try { + // Shuffle the tracklist + const shuffled = [...tracklist].sort(() => Math.random() - 0.5); + // Play the first shuffled track + await playAlbumFromTrack(album.id, shuffled[0].id); + } catch (error) { + console.error('Failed to shuffle album:', error); + } + }; + const isCurrentlyPlaying = (song: Song): boolean => { return currentTrack?.id === song.id; }; @@ -173,6 +186,14 @@ export default function AlbumPage() { > + @@ -200,8 +221,13 @@ export default function AlbumPage() { {/* Controls row */}
+
{/* Album info */}