Fix rating property on card row

This commit is contained in:
jeffvli 2023-01-06 03:32:35 -08:00
parent 624b1bb94d
commit 8bd1cc80bc
3 changed files with 41 additions and 32 deletions

View file

@ -166,7 +166,7 @@ export const ALBUM_CARD_ROWS: { [key: string]: CardRow<Album> } = {
property: 'playCount',
},
rating: {
property: 'rating',
property: 'userRating',
},
releaseDate: {
property: 'releaseDate',
@ -203,7 +203,7 @@ export const ALBUMARTIST_CARD_ROWS: { [key: string]: CardRow<AlbumArtist> } = {
property: 'playCount',
},
rating: {
property: 'rating',
property: 'userRating',
},
songCount: {
property: 'songCount',

View file

@ -98,7 +98,9 @@ export const AlbumListContent = ({ gridRef, tableRef }: AlbumListContentProps) =
...page.filter,
});
const albumsRes = await queryClient.fetchQuery(queryKey, async ({ signal }) =>
const albumsRes = await queryClient.fetchQuery(
queryKey,
async ({ signal }) =>
api.controller.getAlbumList({
query: {
limit,
@ -108,6 +110,7 @@ export const AlbumListContent = ({ gridRef, tableRef }: AlbumListContentProps) =
server,
signal,
}),
{ cacheTime: 1000 * 60 * 1 },
);
const albums = api.normalize.albumList(albumsRes, server);

View file

@ -133,7 +133,9 @@ export const AlbumListHeader = ({ gridRef, tableRef }: AlbumListHeaderProps) =>
...filters,
});
const albums = await queryClient.fetchQuery(queryKey, async ({ signal }) =>
const albums = await queryClient.fetchQuery(
queryKey,
async ({ signal }) =>
controller.getAlbumList({
query: {
limit: take,
@ -143,6 +145,7 @@ export const AlbumListHeader = ({ gridRef, tableRef }: AlbumListHeaderProps) =>
server,
signal,
}),
{ cacheTime: 1000 * 60 * 1 },
);
return api.normalize.albumList(albums, server);
@ -167,7 +170,9 @@ export const AlbumListHeader = ({ gridRef, tableRef }: AlbumListHeaderProps) =>
...filters,
});
const albumsRes = await queryClient.fetchQuery(queryKey, async ({ signal }) =>
const albumsRes = await queryClient.fetchQuery(
queryKey,
async ({ signal }) =>
api.controller.getAlbumList({
query: {
limit,
@ -177,6 +182,7 @@ export const AlbumListHeader = ({ gridRef, tableRef }: AlbumListHeaderProps) =>
server,
signal,
}),
{ cacheTime: 1000 * 60 * 1 },
);
const albums = api.normalize.albumList(albumsRes, server);