diff --git a/CHANGELOG.md b/CHANGELOG.md index 409ed194..64b01cbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -907,6 +907,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * The song rail's previous/next and reroll buttons are now square like every other rail instead of round. +### Search โ€” song results show their album cover + +**By [@Psychotoxical](https://github.com/Psychotoxical), reported by zunoz on Discord, PR [#984](https://github.com/Psychotoxical/psysonic/pull/984)** + +* Song results in the search dropdown now show their album cover instead of leaving most thumbnails blank. + ## [1.46.0] - 2026-05-18 > **๐Ÿ™ Special thanks to [@zz5zz](https://github.com/zz5zz)** for his tireless quirk-spotting and bug reports on the [Psysonic Discord](https://discord.gg/AMnDRErm4u) โ€” several of the polish fixes in this release landed directly off the back of his messages. diff --git a/src/components/LiveSearch.tsx b/src/components/LiveSearch.tsx index 8a6f2aa0..6da2c0ee 100644 --- a/src/components/LiveSearch.tsx +++ b/src/components/LiveSearch.tsx @@ -34,7 +34,7 @@ import { AlbumCoverArtImage } from '../cover/AlbumCoverArtImage'; import { ArtistCoverArtImage } from '../cover/ArtistCoverArtImage'; import { CoverArtImage } from '../cover/CoverArtImage'; import { COVER_DENSE_SEARCH_CSS_PX } from '../cover/layoutSizes'; -import { albumCoverRefForSong } from '../cover/ref'; +import { albumCoverRef } from '../cover/ref'; import { showToast } from '../utils/ui/toast'; import { useShareSearch } from '../hooks/useShareSearch'; import ShareSearchResults from './search/ShareSearchResults'; @@ -71,11 +71,18 @@ function LiveSearchAlbumThumb({ albumId, coverArt }: { albumId: string; coverArt } function LiveSearchSongThumb({ song }: { song: Pick }) { + // Search results carry the per-track `mf-โ€ฆ` coverArt id, which the cover + // pipeline fails to resolve and the thumbnail goes blank. The album-scoped + // `al-_0` id is what actually loads (verified in the RC1 blank-thumb + // investigation), and a song's search thumbnail is its album cover anyway โ€” + // so fetch the album cover from the albumId. Falls back to a music glyph when + // there is no album to key on. + const albumId = song.albumId?.trim(); const coverRef = React.useMemo( - () => (song.albumId?.trim() ? albumCoverRefForSong(song) : undefined), - [song.id, song.albumId, song.coverArt, song.discNumber], + () => (albumId ? albumCoverRef(albumId, `al-${albumId}_0`) : undefined), + [albumId], ); - if (!coverRef) return null; + if (!coverRef) return
; return ( - {(s.coverArt ?? s.albumId) ? ( - - ) : ( -
- )} +
{s.title}
{s.artist} ยท {s.album}