Subsonic 2, general rework (#758)

This commit is contained in:
Kendall Garner 2024-09-26 04:23:08 +00:00 committed by GitHub
parent 31492fa9ef
commit 8cddbef701
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
69 changed files with 4625 additions and 3566 deletions

View file

@ -144,10 +144,6 @@ const PlaylistDetailSongListRoute = () => {
};
const itemCountCheck = usePlaylistSongList({
options: {
cacheTime: 1000 * 60 * 60 * 2,
staleTime: 1000 * 60 * 60 * 2,
},
query: {
id: playlistId,
limit: 1,
@ -157,10 +153,7 @@ const PlaylistDetailSongListRoute = () => {
serverId: server?.id,
});
const itemCount =
itemCountCheck.data?.totalRecordCount === null
? undefined
: itemCountCheck.data?.totalRecordCount;
const itemCount = itemCountCheck.data?.totalRecordCount || itemCountCheck.data?.items.length;
return (
<AnimatedPage key={`playlist-detail-songList-${playlistId}`}>
@ -207,7 +200,12 @@ const PlaylistDetailSongListRoute = () => {
</Paper>
</Box>
)}
<PlaylistDetailSongListContent tableRef={tableRef} />
<PlaylistDetailSongListContent
songs={
server?.type === ServerType.SUBSONIC ? itemCountCheck.data?.items : undefined
}
tableRef={tableRef}
/>
</AnimatedPage>
);
};