mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 18:36:15 -08:00
docs(xtream): cite the measured evidence for the category language gate
The gate's rationale named hypothetical category shapes. On a real catalog the four it actually turns away are VOD (5,245 movies), KIDS (1,010), SHOW and WWE — without it the language select offers "VOD" and "KIDS" as languages. Comments, doc and one spec case only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
29a81baec1
commit
d0c79e5bca
3 files changed
+22
-10
No files matched your search
@@ -223,11 +223,13 @@ per `(playlist_id, xtream_id)` in both query tiers — `char(31)` because the
|
||||
default `,` appears inside real category names), and
|
||||
`unambiguousCategoryLanguage` reduces them: categories without a recognized
|
||||
language prefix abstain, all prefixed ones must agree, and a conflict yields
|
||||
nothing. Category prefixes must additionally pass `isKnownLanguageTag`,
|
||||
because categories routinely start with "NEW |", "TOP |" or "VIP |" — and
|
||||
`new`, `top` and `hot` are even assigned ISO 639-3 codes, which is why the
|
||||
gate is an `Intl.DisplayNames` check for two-letter codes plus a curated list
|
||||
for longer tags rather than a registry lookup. Only the pipe title form stays
|
||||
nothing. Category prefixes must additionally pass `isKnownLanguageTag`.
|
||||
Measured on a real catalog, that gate is what keeps "VOD" (5,245 movies),
|
||||
"KIDS" (1,010), "SHOW" and "WWE" out of a list of LANGUAGES; "NEW |",
|
||||
"TOP |" and "VIP |" are everyday shapes too, and `new`, `top` and `hot` are
|
||||
even assigned ISO 639-3 codes — which is why the gate is an
|
||||
`Intl.DisplayNames` check for two-letter codes plus a curated list for
|
||||
longer tags rather than a registry lookup. Only the pipe title form stays
|
||||
permissive: a tag before a pipe in a movie title is overwhelmingly a
|
||||
language, and tightening the legacy form would drop filter options that work
|
||||
today. The route's own row reads the one category the route arrived through
|
||||
|
||||
@@ -95,6 +95,14 @@ describe('isKnownLanguageTag', () => {
|
||||
expect(isKnownLanguageTag('MULTI')).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects the content-type prefixes categories actually use', () => {
|
||||
// The four the gate turns away most often on a real catalog; without
|
||||
// it the language select offers "VOD" and "KIDS".
|
||||
for (const tag of ['VOD', 'KIDS', 'SHOW', 'WWE']) {
|
||||
expect(isKnownLanguageTag(tag)).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
it('rejects everyday category words that are real ISO 639-3 codes', () => {
|
||||
// `new`, `top` and `hot` are assigned in ISO 639-3, which is exactly
|
||||
// why validation is curated instead of registry-driven.
|
||||
|
||||
@@ -20,11 +20,13 @@ import { PROVIDER_PIPE_CLASS } from './title-normalization.util';
|
||||
* rip tags — "[HD] Dune", "NEW - Dune" — which would not only pollute the
|
||||
* select but, since a title prefix outranks the category language, mask a
|
||||
* real one and get the row excluded by the very filter meant to find it.
|
||||
* - Category names are noisiest: "NEW | 2024", "TOP | 250" and "VIP | Cinema"
|
||||
* are everyday category shapes, and `new`, `top` and `hot` are even real
|
||||
* ISO 639-3 codes, so a prefix read off a category always passes
|
||||
* `isKnownLanguageTag`. Empty beats wrong: an unrecognized tag yields no
|
||||
* language rather than a wrong filter option.
|
||||
* - Category names are noisiest, so a prefix read off a category always
|
||||
* passes `isKnownLanguageTag`. Measured on a real catalog, the gate is what
|
||||
* keeps "VOD" (5,245 movies), "KIDS" (1,010), "SHOW" and "WWE" out of a
|
||||
* list of LANGUAGES; "NEW | 2024" and "TOP | 250" are everyday shapes too,
|
||||
* and `new`, `top` and `hot` are even assigned ISO 639-3 codes — which is
|
||||
* why the gate is curated rather than a registry lookup. Empty beats wrong:
|
||||
* an unrecognized tag yields no language rather than a wrong filter option.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user