mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-04-11 20:20:56 +00:00
fix catalogs to respect addon's manifest config
This commit is contained in:
parent
e0077244c6
commit
75c66961b6
1 changed files with 28 additions and 1 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue