From 2101f1e9a7dd3e9c7364a3dade5861f915c48275 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Mon, 8 May 2023 03:35:23 -0700 Subject: [PATCH] Fix legacy normalizations --- .../components/playlist-detail-song-list-header-filters.tsx | 3 +-- .../features/playlists/components/playlist-list-content.tsx | 3 +-- .../playlists/components/playlist-list-header-filters.tsx | 3 +-- src/renderer/features/playlists/routes/playlist-list-route.tsx | 3 +++ src/renderer/features/songs/components/song-list-content.tsx | 3 +-- .../features/songs/components/song-list-header-filters.tsx | 3 +-- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/renderer/features/playlists/components/playlist-detail-song-list-header-filters.tsx b/src/renderer/features/playlists/components/playlist-detail-song-list-header-filters.tsx index 0232d23d..f550dc57 100644 --- a/src/renderer/features/playlists/components/playlist-detail-song-list-header-filters.tsx +++ b/src/renderer/features/playlists/components/playlist-detail-song-list-header-filters.tsx @@ -146,8 +146,7 @@ export const PlaylistDetailSongListHeaderFilters = ({ { cacheTime: 1000 * 60 * 1 }, ); - const songs = api.normalize.songList(songsRes, server); - params.successCallback(songs?.items || [], songsRes?.totalRecordCount || 0); + params.successCallback(songsRes?.items || [], songsRes?.totalRecordCount || 0); }, rowCount: undefined, }; diff --git a/src/renderer/features/playlists/components/playlist-list-content.tsx b/src/renderer/features/playlists/components/playlist-list-content.tsx index d04f6a4e..4cd996a4 100644 --- a/src/renderer/features/playlists/components/playlist-list-content.tsx +++ b/src/renderer/features/playlists/components/playlist-list-content.tsx @@ -90,8 +90,7 @@ export const PlaylistListContent = ({ tableRef, itemCount }: PlaylistListContent { cacheTime: 1000 * 60 * 1 }, ); - const playlists = api.normalize.playlistList(playlistsRes, server); - params.successCallback(playlists?.items || [], playlistsRes?.totalRecordCount || 0); + params.successCallback(playlistsRes?.items || [], playlistsRes?.totalRecordCount || 0); }, rowCount: undefined, }; diff --git a/src/renderer/features/playlists/components/playlist-list-header-filters.tsx b/src/renderer/features/playlists/components/playlist-list-header-filters.tsx index e01ffd4b..aa1f44cf 100644 --- a/src/renderer/features/playlists/components/playlist-list-header-filters.tsx +++ b/src/renderer/features/playlists/components/playlist-list-header-filters.tsx @@ -97,8 +97,7 @@ export const PlaylistListHeaderFilters = ({ tableRef }: PlaylistListHeaderFilter { cacheTime: 1000 * 60 * 1 }, ); - const playlists = api.normalize.playlistList(playlistsRes, server); - params.successCallback(playlists?.items || [], playlistsRes?.totalRecordCount || 0); + params.successCallback(playlistsRes?.items || [], playlistsRes?.totalRecordCount || 0); }, rowCount: undefined, }; diff --git a/src/renderer/features/playlists/routes/playlist-list-route.tsx b/src/renderer/features/playlists/routes/playlist-list-route.tsx index 0899a2fd..050ef121 100644 --- a/src/renderer/features/playlists/routes/playlist-list-route.tsx +++ b/src/renderer/features/playlists/routes/playlist-list-route.tsx @@ -5,9 +5,11 @@ import { PlaylistListContent } from '/@/renderer/features/playlists/components/p import { PlaylistListHeader } from '/@/renderer/features/playlists/components/playlist-list-header'; import { usePlaylistList } from '/@/renderer/features/playlists/queries/playlist-list-query'; import { AnimatedPage } from '/@/renderer/features/shared'; +import { useCurrentServer } from '/@/renderer/store'; const PlaylistListRoute = () => { const tableRef = useRef(null); + const server = useCurrentServer(); const itemCountCheck = usePlaylistList({ options: { @@ -20,6 +22,7 @@ const PlaylistListRoute = () => { sortOrder: SortOrder.ASC, startIndex: 0, }, + serverId: server?.id, }); const itemCount = diff --git a/src/renderer/features/songs/components/song-list-content.tsx b/src/renderer/features/songs/components/song-list-content.tsx index 092411f3..6ab0921f 100644 --- a/src/renderer/features/songs/components/song-list-content.tsx +++ b/src/renderer/features/songs/components/song-list-content.tsx @@ -79,8 +79,7 @@ export const SongListContent = ({ itemCount, tableRef }: SongListContentProps) = { cacheTime: 1000 * 60 * 1 }, ); - const songs = api.normalize.songList(songsRes, server); - params.successCallback(songs?.items || [], songsRes?.totalRecordCount || 0); + params.successCallback(songsRes?.items || [], songsRes?.totalRecordCount || 0); }, rowCount: undefined, }; diff --git a/src/renderer/features/songs/components/song-list-header-filters.tsx b/src/renderer/features/songs/components/song-list-header-filters.tsx index 434ce971..f8fecd9c 100644 --- a/src/renderer/features/songs/components/song-list-header-filters.tsx +++ b/src/renderer/features/songs/components/song-list-header-filters.tsx @@ -135,8 +135,7 @@ export const SongListHeaderFilters = ({ { cacheTime: 1000 * 60 * 1 }, ); - const songs = api.normalize.songList(songsRes, server); - params.successCallback(songs?.items || [], songsRes?.totalRecordCount || 0); + params.successCallback(songsRes?.items || [], songsRes?.totalRecordCount || 0); }, rowCount: undefined, };