From e819f8618e56fc00a564bbc0eb53d67f36f2b2f9 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 31 Jul 2026 16:12:44 -0400 Subject: [PATCH 1/2] Remove unnecessary passing of fake livetv id --- .../modern/features/libraries/components/PageTabContent.tsx | 1 - .../features/libraries/components/ProgramsSectionView.tsx | 5 +---- src/hooks/useFetchItems.ts | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/apps/modern/features/libraries/components/PageTabContent.tsx b/src/apps/modern/features/libraries/components/PageTabContent.tsx index 484b48bb42..430e09f673 100644 --- a/src/apps/modern/features/libraries/components/PageTabContent.tsx +++ b/src/apps/modern/features/libraries/components/PageTabContent.tsx @@ -34,7 +34,6 @@ const PageTabContent: FC = ({ parentId, currentTab }) => { if (currentTab.viewType === LibraryTab.Programs || currentTab.viewType === LibraryTab.Recordings || currentTab.viewType === LibraryTab.Schedule) { return ( = ({ - parentId, sectionType, isUpcomingRecordingsEnabled = false }) => { const { __legacyApiClient__ } = useApi(); - const { isLoading, data: sectionsWithItems, refetch } = useGetProgramsSectionsWithItems(parentId, sectionType); + const { isLoading, data: sectionsWithItems, refetch } = useGetProgramsSectionsWithItems(sectionType); const { isLoading: isUpcomingRecordingsLoading, data: upcomingRecordings diff --git a/src/hooks/useFetchItems.ts b/src/hooks/useFetchItems.ts index 5d6ab0c75f..02f9509da6 100644 --- a/src/hooks/useFetchItems.ts +++ b/src/hooks/useFetchItems.ts @@ -954,14 +954,13 @@ export const useGetSuggestionSectionsWithItems = ( }; export const useGetProgramsSectionsWithItems = ( - parentId: ParentId, programSectionType: SectionType[] ) => { const currentApi = useApi(); const sections = getProgramSections(); return useQuery({ queryKey: ['ProgramSectionWithItems', { programSectionType }], - queryFn: ({ signal }) => getSectionsWithItems(currentApi, parentId, sections, programSectionType, { signal }), + queryFn: ({ signal }) => getSectionsWithItems(currentApi, undefined, sections, programSectionType, { signal }), enabled: !!currentApi.api && !!currentApi.user?.Id }); }; From 63022b1e1e21f0e27095c13d2c1ba0a337526435 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Fri, 31 Jul 2026 16:13:17 -0400 Subject: [PATCH 2/2] Separate settings key and library id --- src/apps/modern/features/libraries/hooks/useLibrary.tsx | 4 ++-- src/hooks/useCurrentTab.ts | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/apps/modern/features/libraries/hooks/useLibrary.tsx b/src/apps/modern/features/libraries/hooks/useLibrary.tsx index 530519b133..7af88c8684 100644 --- a/src/apps/modern/features/libraries/hooks/useLibrary.tsx +++ b/src/apps/modern/features/libraries/hooks/useLibrary.tsx @@ -35,7 +35,7 @@ export const useLibrary = () => useContext(LibraryContext); export const LibraryProvider: FC> = ({ children }) => { const { pathname } = useLocation(); - const { libraryId, activeTab } = useCurrentTab(); + const { libraryId, activeTab, settingsKey } = useCurrentTab(); const route = useMemo(() => LibraryRoutes.find(({ path }) => path === pathname), [pathname]); const collectionType = route?.type; @@ -48,7 +48,7 @@ export const LibraryProvider: FC> = ({ children }) => // Local storage requires the view type to be known upfront so default to movies if unknown const settingsViewType = viewType ?? LibraryTab.Movies; const [viewSettings, setViewSettings] = useLocalStorage( - getSettingsKey(settingsViewType, libraryId), + getSettingsKey(settingsViewType, settingsKey), getDefaultLibraryViewSettings(settingsViewType) ); diff --git a/src/hooks/useCurrentTab.ts b/src/hooks/useCurrentTab.ts index f2739c00b0..99dbcf1caf 100644 --- a/src/hooks/useCurrentTab.ts +++ b/src/hooks/useCurrentTab.ts @@ -6,10 +6,8 @@ const useCurrentTab = () => { const location = useLocation(); const [searchParams, setSearchParams] = useSearchParams(); const searchParamsTab = searchParams.get('tab'); - const libraryId = - location.pathname === '/livetv' ? - 'livetv' : - searchParams.get('topParentId'); + const libraryId = searchParams.get('topParentId'); + const settingsKey = location.pathname === '/livetv' ? 'livetv' : libraryId; const activeTab: number = searchParamsTab !== null ? parseInt(searchParamsTab, 10) : @@ -19,6 +17,7 @@ const useCurrentTab = () => { searchParams, setSearchParams, libraryId, + settingsKey, activeTab }; };