diff --git a/addon/lib/manifest.js b/addon/lib/manifest.js index 3bc540d..33e6572 100644 --- a/addon/lib/manifest.js +++ b/addon/lib/manifest.js @@ -1,4 +1,5 @@ const { MochOptions } = require('../moch/moch'); +const { showDebridCatalog } = require('../moch/options'); const { Type } = require('./types'); const Providers = [ @@ -58,7 +59,7 @@ function getProvider(configProvider) { function getCatalogs(config) { return CatalogMochs - .filter(moch => config[moch.key]) + .filter(moch => showDebridCatalog(config) && config[moch.key]) .map(moch => ({ id: `torrentio-${moch.key}`, name: `${moch.name}`, @@ -77,7 +78,7 @@ function getResources(config) { types: [Type.OTHER], idPrefixes: CatalogMochs.filter(moch => config[moch.key]).map(moch => moch.key) }; - if (CatalogMochs.filter(moch => config[moch.key]).length) { + if (showDebridCatalog(config) && CatalogMochs.filter(moch => config[moch.key]).length) { return [streamResource, metaResource]; } return [streamResource]; diff --git a/addon/moch/options.js b/addon/moch/options.js index 44e9df5..80e9fc5 100644 --- a/addon/moch/options.js +++ b/addon/moch/options.js @@ -5,6 +5,10 @@ const DebridOptions = { key: 'nodownloadlinks', description: 'Don\'t show download to debrid links' }, + noCatalog: { + key: 'nocatalog', + description: 'Don\'t show debrid catalog' + }, torrentLinks: { key: 'torrentlinks', description: 'Show P2P torrent links for uncached' @@ -22,4 +26,9 @@ function includeTorrentLinks(config) { .includes(DebridOptions.options.torrentLinks.key); } -module.exports = { DebridOptions, excludeDownloadLinks, includeTorrentLinks } \ No newline at end of file +function showDebridCatalog(config) { + return !(config[DebridOptions.key] && config[DebridOptions.key] + .includes(DebridOptions.options.noCatalog.key)); +} + +module.exports = { DebridOptions, excludeDownloadLinks, showDebridCatalog, includeTorrentLinks } \ No newline at end of file