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,16 +98,19 @@ export const AlbumListContent = ({ gridRef, tableRef }: AlbumListContentProps) =
...page.filter,
});
const albumsRes = await queryClient.fetchQuery(queryKey, async ({ signal }) =>
api.controller.getAlbumList({
query: {
limit,
startIndex,
...page.filter,
},
server,
signal,
}),
const albumsRes = await queryClient.fetchQuery(
queryKey,
async ({ signal }) =>
api.controller.getAlbumList({
query: {
limit,
startIndex,
...page.filter,
},
server,
signal,
}),
{ cacheTime: 1000 * 60 * 1 },
);
const albums = api.normalize.albumList(albumsRes, server);

View file

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