From 3aff950598e1a3c09015c1a882467d62a80b680a Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Mon, 11 Aug 2025 08:04:07 +0000 Subject: [PATCH] chore(manifest): add supported languages to description --- src/utils/__snapshots__/manifest.test.ts.snap | 88 +++++++++++++++++++ src/utils/manifest.test.ts | 7 ++ src/utils/manifest.ts | 8 +- 3 files changed, 102 insertions(+), 1 deletion(-) diff --git a/src/utils/__snapshots__/manifest.test.ts.snap b/src/utils/__snapshots__/manifest.test.ts.snap index 4e9ea8e..195c648 100644 --- a/src/utils/__snapshots__/manifest.test.ts.snap +++ b/src/utils/__snapshots__/manifest.test.ts.snap @@ -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`] = ` [ { diff --git a/src/utils/manifest.test.ts b/src/utils/manifest.test.ts index 41fe2bf..0e73ea6 100644 --- a/src/utils/manifest.test.ts +++ b/src/utils/manifest.test.ts @@ -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), diff --git a/src/utils/manifest.ts b/src/utils/manifest.ts index 7a6a63f..a371105 100644 --- a/src/utils/manifest.ts +++ b/src/utils/manifest.ts @@ -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; };