refactor: improve library page, fix playbutton issues, improve overall app performance

This commit is contained in:
--remove-section committed 2025-12-18 22:16:43 +05:30
1 parent 120e283e3d
commit d39c064600
12 files changed
+1867 -2017

No files matched your search

+6 -2
View File
@@ -46,6 +46,7 @@ export const getLibraryItemsQueryOptions = (
params: LibraryItemsParams,
) => {
return queryOptions<BaseItemDtoQueryResult>({
enabled: !!params.currentViewType,
queryKey: [
"library",
"items",
@@ -64,8 +65,13 @@ export const getLibraryItemsQueryOptions = (
],
queryFn: async () => {
if (!api || !userId || !libraryId || !params.currentViewType) {
console.warn(
"getLibraryItemsQueryOptions: Missing required parameters",
{ api, userId, libraryId, currentViewType: params.currentViewType },
);
return { Items: [], TotalRecordCount: 0 } as BaseItemDtoQueryResult;
}
console.info("Fetching library items with params:", params);
const { currentViewType, videoTypesState, filters } = params;
const buildVideoTypes = (state: typeof videoTypesState) => {
const videoTypes: VideoType[] = [];
@@ -168,7 +174,5 @@ export const getLibraryItemsQueryOptions = (
},
staleTime: 5_000,
gcTime: 5 * 60_000,
refetchOnWindowFocus: false,
refetchOnReconnect: false,
});
};