chore(manifest): add supported languages to description
This commit is contained in:
parent
7d700103c4
commit
3aff950598
3 changed files with 102 additions and 1 deletions
|
|
@ -1,5 +1,93 @@
|
|||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`buildManifest default manifest 1`] = `
|
||||
{
|
||||
"behaviorHints": {
|
||||
"configurable": true,
|
||||
"configurationRequired": true,
|
||||
"p2p": false,
|
||||
},
|
||||
"catalogs": [],
|
||||
"config": [
|
||||
{
|
||||
"key": "multi",
|
||||
"title": "Multi 🌐 (VixSrc)",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"key": "de",
|
||||
"title": "German 🇩🇪 (KinoGer, MegaKino, MeineCloud, StreamKiste)",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"key": "en",
|
||||
"title": "English 🇺🇸 (Soaper, VidSrc)",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"key": "es",
|
||||
"title": "Castilian Spanish 🇪🇸 (CineHDPlus, Cuevana, HomeCine, VerHdLink)",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"key": "fr",
|
||||
"title": "French 🇫🇷 (FrenchCloud, Movix)",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"key": "it",
|
||||
"title": "Italian 🇮🇹 (VixSrc, Eurostreaming, MostraGuarda)",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"key": "mx",
|
||||
"title": "Latin American Spanish 🇲🇽 (CineHDPlus, Cuevana, HomeCine, VerHdLink)",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"key": "showErrors",
|
||||
"title": "Show errors",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"key": "includeExternalUrls",
|
||||
"title": "Include external URLs in results",
|
||||
"type": "checkbox",
|
||||
},
|
||||
{
|
||||
"default": "",
|
||||
"key": "mediaFlowProxyUrl",
|
||||
"title": "MediaFlow Proxy URL",
|
||||
"type": "text",
|
||||
},
|
||||
{
|
||||
"default": "",
|
||||
"key": "mediaFlowProxyPassword",
|
||||
"title": "MediaFlow Proxy Password",
|
||||
"type": "password",
|
||||
},
|
||||
],
|
||||
"description": "Provides HTTP URLs from streaming websites. Configure add-on for additional languages. Add MediaFlow proxy for more URLs. Supported languages: German, English, Castilian Spanish, French, Italian, Latin American Spanish",
|
||||
"id": "webstreamr",
|
||||
"idPrefixes": [
|
||||
"tt",
|
||||
],
|
||||
"name": "WebStreamr",
|
||||
"resources": [
|
||||
"stream",
|
||||
],
|
||||
"stremioAddonsConfig": {
|
||||
"issuer": "https://stremio-addons.net",
|
||||
"signature": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0..D3-Wl15vxnYltwx8G52rRg.16-0VzsSgTvnv0wampIR8YPZsFhH8-7IgpuqxcUfC2p7kIJtuk8xQzrzqQOLXANEpaH_w7a4JOEpNo8wv28Zo_nMGCLOXgWbyGM3sQ-tfq6DCK3JU0ol6YMC1UDX2z_c.IOLlZyTYx_swutjYSTES0Q",
|
||||
},
|
||||
"types": [
|
||||
"movie",
|
||||
"series",
|
||||
],
|
||||
"version": "0.41.3",
|
||||
}
|
||||
`;
|
||||
|
||||
exports[`buildManifest disable extractors 1`] = `
|
||||
[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { DoodStream } from '../extractor/DoodStream';
|
||||
import { ExternalUrl } from '../extractor/ExternalUrl';
|
||||
import { SuperVideo } from '../extractor/SuperVideo';
|
||||
import { createSources } from '../source';
|
||||
import { MeineCloud } from '../source/MeineCloud';
|
||||
import { StreamKiste } from '../source/StreamKiste';
|
||||
import { VerHdLink } from '../source/VerHdLink';
|
||||
|
|
@ -11,6 +12,12 @@ import { buildManifest } from './manifest';
|
|||
const fetcher = new FetcherMock('/dev/null');
|
||||
|
||||
describe('buildManifest', () => {
|
||||
test('default manifest', async () => {
|
||||
const manifest = buildManifest(createSources(fetcher), [], {});
|
||||
|
||||
expect(manifest).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('has unchecked source without a config', () => {
|
||||
const sources = [
|
||||
new VixSrc(fetcher),
|
||||
|
|
|
|||
|
|
@ -48,11 +48,15 @@ export const buildManifest = (sources: Source[], extractors: Extractor[], config
|
|||
return countryCodeA.localeCompare(countryCodeB);
|
||||
});
|
||||
|
||||
const languages: string[] = [];
|
||||
for (const [countryCode, sources] of sortedLanguageSources) {
|
||||
const language = languageFromCountryCode(countryCode);
|
||||
languages.push(language);
|
||||
|
||||
manifest.config.push({
|
||||
key: countryCode,
|
||||
type: 'checkbox',
|
||||
title: `${languageFromCountryCode(countryCode)} ${flagFromCountryCode(countryCode)} (${(sources as Source[]).map(handler => handler.label).join(', ')})`,
|
||||
title: `${language} ${flagFromCountryCode(countryCode)} (${(sources as Source[]).map(handler => handler.label).join(', ')})`,
|
||||
...(countryCode in config && { default: 'checked' }),
|
||||
});
|
||||
}
|
||||
|
|
@ -98,5 +102,7 @@ export const buildManifest = (sources: Source[], extractors: Extractor[], config
|
|||
});
|
||||
});
|
||||
|
||||
manifest.description += ` Supported languages: ${languages.filter(language => language !== 'Multi').join(', ')}`;
|
||||
|
||||
return manifest;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue