Drop implausible season/episode numbers in ziggogo.tv - #3225
Open
quepasaquepasa wants to merge 2 commits into
Open
Drop implausible season/episode numbers in ziggogo.tv#3225quepasaquepasa wants to merge 2 commits into
quepasaquepasa wants to merge 2 commits into
Conversation
quepasaquepasa
force-pushed
the
fix-ziggogo-bogus-episode-numbers
branch
from
July 31, 2026 02:33
f169eb3 to
b4a05f2
Compare
freearhey
previously requested changes
Aug 1, 2026
freearhey
left a comment
Collaborator
There was a problem hiding this comment.
Test failed:
npm test --- ziggogo.tv
> test
> cross-env TZ=Pacific/Nauru npx jest --runInBand ziggogo.tv
FAIL sites/ziggogo.tv/ziggogo.tv.test.js
✓ can generate valid url (7 ms)
✕ can parse response (18 ms)
✓ can handle empty guide (1 ms)
● can parse response
expect(received).toMatchObject(expected)
- Expected - 2
+ Received + 2
@@ -2,11 +2,11 @@
"category": Array [
"Consumentenprogramma's",
"Shoppen",
],
"description": "Homeshoppingprogramma waarin de kijker via de telefoon allerlei producten kan aanschaffen.",
- "episode": 492767862,
- "season": 78610000,
+ "episode": null,
+ "season": null,
"start": "2026-05-30T04:00:00.000Z",
"stop": "2026-05-30T11:03:00.000Z",
"title": "Telvero",
}
61 |
62 | expect(result.length).toBe(21)
> 63 | expect(result[2]).toMatchObject({
| ^
64 | start: '2026-05-30T04:00:00.000Z',
65 | stop: '2026-05-30T11:03:00.000Z',
66 | title: 'Telvero',
at Object.toMatchObject (sites/ziggogo.tv/ziggogo.tv.test.js:63:21)
Test Suites: 1 failed, 1 total
Tests: 1 failed, 2 passed, 3 total
Snapshots: 0 total
Time: 0.766 s
Ran all test suites matching ziggogo.tv.
Contributor
Author
|
Thanks — fixed in 4de574e. The stored fixture pins the current behaviour, so changing it necessarily broke that assertion; I should have updated the test in the same commit. What's useful is that the fixture happens to contain both cases, which makes it a good check on the thresholds:
So the same fixture now demonstrates that only the implausible values are removed. |
PopeyeTheSai10r
approved these changes
Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2977
Events without real season/episode data get internal ids leaked into
seasonNumber/episodeNumberby the upstream API. Sampled live data today:The ziggogo.tv frontend hides these values; this PR does the same by dropping
seasonoutside(0, 1000)andepisodeoutside(0, 100000). The gap between real data (seasons ≤ ~100, episodes ≤ ~10k for daily shows) and the garbage (≥ 5×10⁶) is several orders of magnitude, so the thresholds have wide safety margins on both sides — addressing the concern raised in the issue thread about long-running shows with 4-digit episode numbers, which are preserved.Verified against today's live guide for NPO 1: 52 programmes parsed, real values kept (
S9 E10,S2 E11), bogus ids now omitted.