mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
change addon name based on debrid configured
This commit is contained in:
@@ -8,10 +8,11 @@ const DefaultProviders = Providers.options.map(provider => provider.key);
|
|||||||
const CatalogMochs = Object.values(MochOptions).filter(moch => moch.catalog);
|
const CatalogMochs = Object.values(MochOptions).filter(moch => moch.catalog);
|
||||||
|
|
||||||
export function manifest(config = {}) {
|
export function manifest(config = {}) {
|
||||||
const defaultManifest = {
|
const overrideManifest = getManifestOverride(config);
|
||||||
|
const baseManifest = {
|
||||||
id: 'com.stremio.torrentio.addon',
|
id: 'com.stremio.torrentio.addon',
|
||||||
version: '0.0.14',
|
version: '0.0.14',
|
||||||
name: 'Torrentio',
|
name: getName(overrideManifest, config),
|
||||||
description: getDescription(config),
|
description: getDescription(config),
|
||||||
catalogs: getCatalogs(config),
|
catalogs: getCatalogs(config),
|
||||||
resources: getResources(config),
|
resources: getResources(config),
|
||||||
@@ -22,9 +23,8 @@ export function manifest(config = {}) {
|
|||||||
configurable: true,
|
configurable: true,
|
||||||
configurationRequired: false
|
configurationRequired: false
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
const overrideManifest = getManifestOverride(config);
|
return Object.assign(baseManifest, overrideManifest);
|
||||||
return Object.assign(defaultManifest, overrideManifest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function dummyManifest() {
|
export function dummyManifest() {
|
||||||
@@ -34,6 +34,15 @@ export function dummyManifest() {
|
|||||||
return manifestDefault;
|
return manifestDefault;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getName(manifest, config) {
|
||||||
|
const rootName = manifest?.name || 'Torrentio';
|
||||||
|
const mochSuffix = Object.values(MochOptions)
|
||||||
|
.filter(moch => config[moch.key])
|
||||||
|
.map(moch => moch.shortName)
|
||||||
|
.join('/');
|
||||||
|
return [rootName, mochSuffix].filter(v => v).join(' ');
|
||||||
|
}
|
||||||
|
|
||||||
function getDescription(config) {
|
function getDescription(config) {
|
||||||
const providersList = config[Providers.key] || DefaultProviders;
|
const providersList = config[Providers.key] || DefaultProviders;
|
||||||
const enabledProvidersDesc = Providers.options
|
const enabledProvidersDesc = Providers.options
|
||||||
|
|||||||
Reference in New Issue
Block a user