Fix legacy normalizations

This commit is contained in:
jeffvli 2023-05-08 03:35:23 -07:00
parent 8a0a8e4d54
commit 2101f1e9a7
6 changed files with 8 additions and 10 deletions

View file

@ -146,8 +146,7 @@ export const PlaylistDetailSongListHeaderFilters = ({
{ cacheTime: 1000 * 60 * 1 }, { cacheTime: 1000 * 60 * 1 },
); );
const songs = api.normalize.songList(songsRes, server); params.successCallback(songsRes?.items || [], songsRes?.totalRecordCount || 0);
params.successCallback(songs?.items || [], songsRes?.totalRecordCount || 0);
}, },
rowCount: undefined, rowCount: undefined,
}; };

View file

@ -90,8 +90,7 @@ export const PlaylistListContent = ({ tableRef, itemCount }: PlaylistListContent
{ cacheTime: 1000 * 60 * 1 }, { cacheTime: 1000 * 60 * 1 },
); );
const playlists = api.normalize.playlistList(playlistsRes, server); params.successCallback(playlistsRes?.items || [], playlistsRes?.totalRecordCount || 0);
params.successCallback(playlists?.items || [], playlistsRes?.totalRecordCount || 0);
}, },
rowCount: undefined, rowCount: undefined,
}; };

View file

@ -97,8 +97,7 @@ export const PlaylistListHeaderFilters = ({ tableRef }: PlaylistListHeaderFilter
{ cacheTime: 1000 * 60 * 1 }, { cacheTime: 1000 * 60 * 1 },
); );
const playlists = api.normalize.playlistList(playlistsRes, server); params.successCallback(playlistsRes?.items || [], playlistsRes?.totalRecordCount || 0);
params.successCallback(playlists?.items || [], playlistsRes?.totalRecordCount || 0);
}, },
rowCount: undefined, rowCount: undefined,
}; };

View file

@ -5,9 +5,11 @@ import { PlaylistListContent } from '/@/renderer/features/playlists/components/p
import { PlaylistListHeader } from '/@/renderer/features/playlists/components/playlist-list-header'; import { PlaylistListHeader } from '/@/renderer/features/playlists/components/playlist-list-header';
import { usePlaylistList } from '/@/renderer/features/playlists/queries/playlist-list-query'; import { usePlaylistList } from '/@/renderer/features/playlists/queries/playlist-list-query';
import { AnimatedPage } from '/@/renderer/features/shared'; import { AnimatedPage } from '/@/renderer/features/shared';
import { useCurrentServer } from '/@/renderer/store';
const PlaylistListRoute = () => { const PlaylistListRoute = () => {
const tableRef = useRef<AgGridReactType | null>(null); const tableRef = useRef<AgGridReactType | null>(null);
const server = useCurrentServer();
const itemCountCheck = usePlaylistList({ const itemCountCheck = usePlaylistList({
options: { options: {
@ -20,6 +22,7 @@ const PlaylistListRoute = () => {
sortOrder: SortOrder.ASC, sortOrder: SortOrder.ASC,
startIndex: 0, startIndex: 0,
}, },
serverId: server?.id,
}); });
const itemCount = const itemCount =

View file

@ -79,8 +79,7 @@ export const SongListContent = ({ itemCount, tableRef }: SongListContentProps) =
{ cacheTime: 1000 * 60 * 1 }, { cacheTime: 1000 * 60 * 1 },
); );
const songs = api.normalize.songList(songsRes, server); params.successCallback(songsRes?.items || [], songsRes?.totalRecordCount || 0);
params.successCallback(songs?.items || [], songsRes?.totalRecordCount || 0);
}, },
rowCount: undefined, rowCount: undefined,
}; };

View file

@ -135,8 +135,7 @@ export const SongListHeaderFilters = ({
{ cacheTime: 1000 * 60 * 1 }, { cacheTime: 1000 * 60 * 1 },
); );
const songs = api.normalize.songList(songsRes, server); params.successCallback(songsRes?.items || [], songsRes?.totalRecordCount || 0);
params.successCallback(songs?.items || [], songsRes?.totalRecordCount || 0);
}, },
rowCount: undefined, rowCount: undefined,
}; };