Skip to content

0.23.0: every series on TheTVDB, with the attribution link its terms require - #92

Merged
ralyodio merged 3 commits into
mainfrom
feat/thetvdb-integrate
Sep 13, 2026
Merged

0.23.0: every series on TheTVDB, with the attribution link its terms require#92
ralyodio merged 3 commits into
mainfrom
feat/thetvdb-integrate

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The screen collection gains thetvdb-catalog: every series on TheTVDB, /v4/series walked 500 a page once, then /v4/updates for what changed, the month-long bearer kept in the cursor and renewed on a 401.

TheTVDB's API terms (thetvdb.com/api-information) allow commercial use free under $50k a year and require attribution with a direct link, so every row carries data.attribution "Metadata provided by TheTVDB.com" and data.attributionUrl. The key is THETVDB_API_KEY, which lived in the bittorrented vault; it is now in nichedb--prod and on the Railway service, so this source runs on deploy.

Built on its own branch and adversarially reviewed. The review fixed two real gaps: the first delta mark was the walk's end time, so a series changed during the ~3-hour walk was missed until its next change (now the mark is when the walk began), and a delta run with its deadline already past reported itself caught up after reading nothing. Live probe: login, page 0 and 1 (500 rows each) and one updates call through the adapter's own URL builders.

Version 0.23.0. bun test all green, lint clean for the new files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CDEiDss9RWYibtmxSk5Gr2

ralyodio and others added 3 commits September 13, 2026 09:29
TVmaze rows already carry data.thetvdbId and the *arr family keys on it, so
the screen collection wanted the catalogue that id belongs to: 173,000
series against TVmaze's 90,000. The adapter walks /v4/series 500 a page
(capped at 20 pages a run, resuming from the cursor, done on an empty page
or a null links.next since the API answers 200 past the end), then keeps
current from /v4/updates?type=series, re-reading only the changed ids from
/series/<id>/extended?short=true, the one endpoint that carries genres
(which decide tv against anime), the IMDb and TMDB ids and the network.

The v4 login JWT rides in the cursor with its expiry, the way igdb keeps
its Twitch token, renewed within a day of expiry or on a 401. The key is
redacted from every log line, note and error, and a refused login ends the
run at once rather than counting as three page failures.

TheTVDB's terms require attribution with a direct link shown to end users,
so every row carries data.attribution and data.attributionUrl.

Config and ingest gain THETVDB_API_KEY plumbing; the adapter is not yet
registered in the index, which integration does.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDEiDss9RWYibtmxSk5Gr2
…k began

A walk is many runs over a few hours, so a series changed after its page
was read but before the last page landed was missed until its next change.
The cursor now carries startedAt from the first page and the completed walk
commits it as refreshedAt; /updates takes since inclusively and the ids are
deduped, so the overlap costs a few listing pages and loses nothing.

Also: a delta run whose deadline is already past reads no listing page and
now keeps the previous mark instead of committing "now" with nothing read.

Reviewed live against api4.thetvdb.com: login, /series pages 0 and 1 (500
rows each, parsed to 500 items each with no shape violations), one /updates
listing (since is inclusive, reaches 40 days back), one extended row, the
past-the-end 200 and the bad-bearer 401 all match the fixtures.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDEiDss9RWYibtmxSk5Gr2
…require

The screen collection gains thetvdb-catalog: /v4/series walked 500 a page
once, then /v4/updates for what changed, the month-long bearer kept in the
cursor and renewed on a 401. TheTVDB's API terms allow commercial use free
under $50k a year and require attribution with a direct link, so every row
carries "Metadata provided by TheTVDB.com" and the link. The key is
THETVDB_API_KEY, found in the bittorrented vault and copied to nichedb's.

Built on its own branch and adversarially reviewed: the review moved the
first delta mark back to when the walk began (a series changed during the
three-hour walk was otherwise missed until its next change) and stopped a
zero-page delta run from reporting itself caught up.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CDEiDss9RWYibtmxSk5Gr2
@ralyodio
ralyodio merged commit 42d4c03 into main Sep 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant