From 75c66961b69b125b7752a5e855bdbda394655386 Mon Sep 17 00:00:00 2001 From: chrisk325 Date: Sat, 14 Mar 2026 18:23:02 +0530 Subject: [PATCH] fix catalogs to respect addon's manifest config --- src/screens/HomeScreen.tsx | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 4e710706..65eb0491 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -244,7 +244,34 @@ const HomeScreen = () => { for (const addon of addons) { if (addon.catalogs) { for (const catalog of addon.catalogs) { - // Check if this catalog is enabled (default to true if no setting exists) + // ── Manifest-level hard gates (cannot be overridden by user settings) ── + + // 1. Never show search catalogs (search.movie, search.series, etc.) + if ( + (catalog.id && catalog.id.startsWith('search.')) || + (catalog.type && catalog.type.startsWith('search')) + ) { + continue; + } + + // 2. Never show catalogs that have any required extra + // (e.g. required genre, calendarVideosIds — these need params to load) + const requiredExtras = (catalog.extra || []) + .filter((e: any) => e.isRequired) + .map((e: any) => e.name); + if (requiredExtras.length > 0) { + continue; + } + + // 3. Respect showInHome flag — if the addon uses it on any catalog, + // only catalogs with showInHome:true are eligible for home. + const addonUsesShowInHome = addon.catalogs.some((c: any) => c.showInHome === true); + if (addonUsesShowInHome && !(catalog as any).showInHome) { + continue; + } + + // ── User toggle (mmkv) — applied on top of manifest gates ── + // Default is true unless the manifest gates above have already filtered it out. const settingKey = `${addon.id}:${catalog.type}:${catalog.id}`; const isEnabled = catalogSettings[settingKey] ?? true;