improve similar items fallback, make ND album artist for song actually album artist, fix full screen race

This commit is contained in:
Kendall Garner 2024-04-08 08:49:55 -07:00
parent 2257e439a4
commit 14086ebc9c
No known key found for this signature in database
GPG key ID: 18D2767419676C87
15 changed files with 136 additions and 17 deletions

View file

@ -159,6 +159,11 @@ const SongPropertyMapping: ItemDetailRow<Song>[] = [
{ key: 'name', label: 'common.title' },
{ key: 'path', label: 'common.path', render: SongPath },
{ label: 'entity.albumArtist_one', render: formatArtists },
{
key: 'artists',
label: 'entity.artist_other',
render: (song) => song.artists.map((artist) => artist.name).join(' · '),
},
{ key: 'album', label: 'entity.album_one' },
{ key: 'discNumber', label: 'common.disc' },
{ key: 'trackNumber', label: 'common.trackNumber' },
@ -229,6 +234,7 @@ export const ItemDetailsModal = ({ item }: ItemDetailsModalProps) => {
<Table
highlightOnHover
horizontalSpacing="sm"
sx={{ userSelect: 'text' }}
verticalSpacing="sm"
>
<tbody>{body}</tbody>

View file

@ -206,10 +206,7 @@ export const FullScreenPlayerImage = () => {
justify="flex-start"
p="1rem"
>
<ImageContainer
ref={mainImageRef}
onLoad={updateImageSize}
>
<ImageContainer ref={mainImageRef}>
<AnimatePresence
initial={false}
mode="sync"

View file

@ -30,7 +30,7 @@ export const SimilarSongsList = ({ count, fullScreen, song }: SimilarSongsListPr
cacheTime: 1000 * 60 * 2,
staleTime: 1000 * 60 * 1,
},
query: { count, songId: song.id },
query: { albumArtistIds: song.albumArtists.map((art) => art.id), count, songId: song.id },
serverId: song?.serverId,
});

View file

@ -16,10 +16,14 @@ export const useSimilarSongs = (args: QueryHookArgs<SimilarSongsQuery>) => {
return api.controller.getSimilarSongs({
apiClientProps: { server, signal },
query: { count: query.count ?? 50, songId: query.songId },
query: {
albumArtistIds: query.albumArtistIds,
count: query.count ?? 50,
songId: query.songId,
},
});
},
queryKey: queryKeys.albumArtists.detail(server?.id || '', query),
queryKey: queryKeys.songs.similar(server?.id || '', query),
...options,
});
};

View file

@ -139,6 +139,11 @@ const FILTERS = {
name: i18n.t('filter.playCount', { postProcess: 'titleCase' }),
value: SongListSort.PLAY_COUNT,
},
{
defaultOrder: SortOrder.ASC,
name: i18n.t('filter.random', { postProcess: 'titleCase' }),
value: SongListSort.RANDOM,
},
{
defaultOrder: SortOrder.DESC,
name: i18n.t('filter.rating', { postProcess: 'titleCase' }),