fix: update cover art URL size for improved image quality in audio player and playlist

This commit is contained in:
2025-07-23 04:47:47 +00:00
committed by GitHub
parent 463be90779
commit bbdee30f92
11 changed files with 23 additions and 23 deletions

View File

@@ -121,7 +121,7 @@ export default function AlbumPage() {
};
// Get cover art URL with proper fallback
const coverArtUrl = album.coverArt && api
? api.getCoverArtUrl(album.coverArt, 300)
? api.getCoverArtUrl(album.coverArt, 1200)
: '/default-user.jpg';
return (

View File

@@ -103,7 +103,7 @@ export default function ArtistPage() {
}
// Get artist image URL with proper fallback
const artistImageUrl = artist.coverArt && api
? api.getCoverArtUrl(artist.coverArt, 300)
? api.getCoverArtUrl(artist.coverArt, 1200)
: '/default-user.jpg';
return (

View File

@@ -105,7 +105,7 @@ export const AudioPlayerProvider: React.FC<{ children: React.ReactNode }> = ({ c
artist: song.artist,
album: song.album,
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 300) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
albumId: song.albumId,
artistId: song.artistId,
starred: !!song.starred

View File

@@ -36,7 +36,7 @@ export function PopularSongs({ songs, artistName }: PopularSongsProps) {
artist: song.artist,
album: song.album,
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 300) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
albumId: song.albumId,
artistId: song.artistId,
starred: !!song.starred
@@ -95,7 +95,7 @@ export function PopularSongs({ songs, artistName }: PopularSongsProps) {
<div className="relative w-12 h-12 bg-muted rounded-md overflow-hidden shrink-0">
{song.coverArt && api && (
<Image
src={api.getCoverArtUrl(song.coverArt, 96)}
src={api.getCoverArtUrl(song.coverArt, 300)}
alt={song.album}
width={48}
height={48}

View File

@@ -90,7 +90,7 @@ export function SongRecommendations({ userName }: SongRecommendationsProps) {
album: song.album || 'Unknown Album',
albumId: song.albumId || '',
duration: song.duration || 0,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 300) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
starred: !!song.starred
};
await playTrack(track, true);
@@ -167,7 +167,7 @@ export function SongRecommendations({ userName }: SongRecommendationsProps) {
{song.coverArt && api ? (
<>
<Image
src={api.getCoverArtUrl(song.coverArt, 100)}
src={api.getCoverArtUrl(song.coverArt, 300)}
alt={song.title}
fill
className="object-cover"

View File

@@ -50,7 +50,7 @@ export function AlbumArtwork({
// Memoize cover art URL to prevent recalculation on every render
const coverArtUrl = useMemo(() => {
if (!api || !album.coverArt) return '/default-user.jpg';
return api.getCoverArtUrl(album.coverArt);
return api.getCoverArtUrl(album.coverArt, 1200);
}, [api, album.coverArt]);
// Use callback to prevent function recreation on every render
@@ -93,7 +93,7 @@ export function AlbumArtwork({
artistId: song.artistId,
url: api.getStreamUrl(song.id),
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
starred: !!song.starred
}));

View File

@@ -109,7 +109,7 @@ export function Sidebar({ className, playlists, visible = true, favoriteAlbums =
>
{album.coverArt && api ? (
<Image
src={api.getCoverArtUrl(album.coverArt, 32)}
src={api.getCoverArtUrl(album.coverArt, 150)}
alt={album.name}
width={16}
height={16}
@@ -165,7 +165,7 @@ export function Sidebar({ className, playlists, visible = true, favoriteAlbums =
>
{album.coverArt && api ? (
<Image
src={api.getCoverArtUrl(album.coverArt, 32)}
src={api.getCoverArtUrl(album.coverArt, 150)}
alt={album.name}
width={16}
height={16}

View File

@@ -58,7 +58,7 @@ const FavoritesPage = () => {
artistId: song.artistId,
url: api?.getStreamUrl(song.id) || '',
duration: song.duration,
coverArt: song.coverArt ? api?.getCoverArtUrl(song.coverArt) : undefined,
coverArt: song.coverArt ? api?.getCoverArtUrl(song.coverArt, 1200) : undefined,
starred: !!song.starred
});
};
@@ -78,7 +78,7 @@ const FavoritesPage = () => {
artistId: song.artistId,
url: api.getStreamUrl(song.id),
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
starred: !!song.starred
}));
@@ -201,7 +201,7 @@ const FavoritesPage = () => {
<div className="w-12 h-12 relative shrink-0">
{song.coverArt && api ? (
<Image
src={api.getCoverArtUrl(song.coverArt)}
src={api.getCoverArtUrl(song.coverArt, 1200)}
alt={song.album}
fill
className="rounded object-cover"

View File

@@ -53,7 +53,7 @@ const PlaylistsPage: React.FC = () => {
<ScrollArea>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 pb-4"> {playlists.map((playlist) => {
const playlistCoverUrl = playlist.coverArt && api
? api.getCoverArtUrl(playlist.coverArt, 200)
? api.getCoverArtUrl(playlist.coverArt, 600)
: '/default-user.jpg';
return (

View File

@@ -114,7 +114,7 @@ export default function SongsPage() {
artist: song.artist,
album: song.album,
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 300) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
albumId: song.albumId,
artistId: song.artistId,
starred: !!song.starred
@@ -135,7 +135,7 @@ export default function SongsPage() {
artist: song.artist,
album: song.album,
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 300) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
albumId: song.albumId,
artistId: song.artistId,
starred: !!song.starred
@@ -240,7 +240,7 @@ export default function SongsPage() {
{/* Album Art */}
<div className="w-12 h-12 mr-4 shrink-0"> <Image
src={song.coverArt && api ? api.getCoverArtUrl(song.coverArt, 100) : '/default-user.jpg'}
src={song.coverArt && api ? api.getCoverArtUrl(song.coverArt, 300) : '/default-user.jpg'}
alt={song.album}
width={48}
height={48}

View File

@@ -57,7 +57,7 @@ export default function PlaylistPage() {
artist: song.artist,
album: song.album,
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 300) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
albumId: song.albumId,
artistId: song.artistId,
starred: !!song.starred
@@ -77,7 +77,7 @@ export default function PlaylistPage() {
artist: song.artist,
album: song.album,
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 300) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
albumId: song.albumId,
artistId: song.artistId,
starred: !!song.starred
@@ -98,7 +98,7 @@ export default function PlaylistPage() {
artist: song.artist,
album: song.album,
duration: song.duration,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 300) : undefined,
coverArt: song.coverArt ? api.getCoverArtUrl(song.coverArt, 1200) : undefined,
albumId: song.albumId,
artistId: song.artistId,
starred: !!song.starred
@@ -140,7 +140,7 @@ export default function PlaylistPage() {
}
// Get playlist cover art URL with fallback
const playlistCoverUrl = playlist.coverArt && api
? api.getCoverArtUrl(playlist.coverArt, 300)
? api.getCoverArtUrl(playlist.coverArt, 1200)
: '/default-user.jpg';
return (
@@ -209,7 +209,7 @@ export default function PlaylistPage() {
{/* Album Art */}
<div className="w-12 h-12 mr-4 shrink-0"> <Image
src={song.coverArt && api ? api.getCoverArtUrl(song.coverArt, 100) : '/default-user.jpg'}
src={song.coverArt && api ? api.getCoverArtUrl(song.coverArt, 300) : '/default-user.jpg'}
alt={song.album}
width={48}
height={48}