Skip to content

The IMDb tables and a torrent's title can come from nichedb - #216

Merged
ralyodio merged 1 commit into
masterfrom
nichedb-titles
Sep 10, 2026
Merged

The IMDb tables and a torrent's title can come from nichedb#216
ralyodio merged 1 commit into
masterfrom
nichedb-titles

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

bittorrented imported the IMDb dumps nightly and asked TMDB for every torrent page's poster. nichedb.dev keeps both now, so this adds the other path and leaves the old one in place. Nothing changes until a switch is set.

NICHEDB_TITLES=1 (app env): a torrent page asks nichedb.dev/api/v1/match what its name is before TMDB, and takes the answer only when it comes with a poster or a synopsis; a bare IMDb row falls through to TMDB so no page loses its picture. The tmdb_data row written is the same shape either way.

NICHEDB_MIRROR=1 (when running setup-server.sh): the nightly crontab line runs pnpm mirror:imdb instead of the dump import, filling imdb_title_basics and imdb_title_ratings from IMDb-sourced rows. TMDB and TVmaze rows only add a title they know the tconst of and never write a rating (different scale). A cursor in nichedb_mirror_cursor resumes a walk cut short by the request budget; the first run is the backfill (pnpm mirror:imdb -- --all, about 1,700 pages seven seconds apart, ~3.3 h).

Not carried by nichedb, so frozen at their last dump under the mirror: crew, principals, episodes, akas, names. The director line on a DHT page is the visible one.

Tests: 51 new (mapping, match pick, cursor paging, fetch order), suite 2,839 pass, tsc clean, lint 0 errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_014X1XCwt5iD3nqZfbddZqEP

…f the dumps and TMDB

bittorrented imported the IMDb dumps nightly and asked TMDB for every
torrent page's poster. nichedb.dev keeps both now, so this adds the
other path and leaves the old one in place.

With NICHEDB_TITLES=1 a torrent page asks nichedb what its name is
before TMDB, and takes the answer only when it comes with a poster or
a synopsis; a bare IMDb row falls through to TMDB so no page loses its
picture. The tmdb_data row written is the same shape either way.

With NICHEDB_MIRROR=1 the nightly crontab line runs a walk of the
screen collection instead of the dump import, filling
imdb_title_basics and imdb_title_ratings from IMDb-sourced rows
(TMDB and TVmaze rows only add a title they know the tconst of, and
never write a rating, since theirs is a different scale). A cursor in
nichedb_mirror_cursor resumes a walk cut short by the request budget;
the first run is the backfill, about 1,700 pages seven seconds apart.

Crew, principals, episodes, akas and names are not in nichedb, so
those tables stop refreshing under the mirror; the director line on a
DHT page freezes at its last dump value until nichedb carries crew.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014X1XCwt5iD3nqZfbddZqEP
@ralyodio
ralyodio merged commit 91b47de into master Sep 10, 2026
7 checks passed
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

99 finding(s)

HIGH/CRITICAL: 11 | MEDIUM: 29 | LOW: 59

Severity Rule Location
HIGH secret-private-key src/app/settings/seedbox-section.tsx:412
HIGH secret-generic-api-key docs/incidents/2026-05-okshanaby-supply-chain.md:18
HIGH tls-verification-disabled src/app/api/iptv-proxy/route.ts:38
HIGH tls-verification-disabled src/app/api/iptv/channels/route.ts:35
HIGH tls-verification-disabled src/app/api/iptv/playlists/[id]/route.ts:73
HIGH tls-verification-disabled src/app/api/iptv/playlists/route.ts:64
HIGH js-cors-origin-reflected src/app/api/public/shares/[slug]/checkout/route.ts:40
HIGH js-cors-origin-reflected src/app/api/public/vod/[slug]/checkout/route.ts:34
HIGH tls-verification-disabled src/lib/iptv/shares/upstream.ts:37
HIGH tls-verification-disabled workers/iptv-cache/epg-fetcher.ts:25
HIGH tls-verification-disabled workers/iptv-cache/playlist-fetcher.ts:62
MEDIUM secret-jwt .github/workflows/ci.yml:120
MEDIUM secret-jwt .github/workflows/ci.yml:121
MEDIUM secret-jwt .github/workflows/ci.yml:123
MEDIUM secret-jwt .github/workflows/ci.yml:162
MEDIUM secret-jwt .github/workflows/ci.yml:164
MEDIUM secret-jwt docs/tunein (2).py:9
MEDIUM secret-jwt docs/tunein.py:9
MEDIUM sh-remote-script-execution scripts/setup-server.sh:182
MEDIUM sh-remote-script-execution scripts/setup-server.sh:419
MEDIUM sh-remote-script-execution scripts/setup-server.sh:428
MEDIUM sh-unquoted-expansion-destructive scripts/setup-server.sh:1096
MEDIUM sh-unquoted-expansion-destructive scripts/setup-server.sh:1106
MEDIUM js-unescaped-html-sink src/app/api/player/route.ts:110
MEDIUM js-unescaped-html-sink src/app/api/player/route.ts:249
MEDIUM js-unescaped-html-sink src/app/blog/[slug]/page.tsx:40
MEDIUM js-unescaped-html-sink src/app/blog/[slug]/page.tsx:66
MEDIUM js-unescaped-html-sink src/app/email/email-content.tsx:566
MEDIUM js-open-redirect src/app/login/page.tsx:50
MEDIUM js-open-redirect src/app/pricing/page.tsx:162
MEDIUM js-open-redirect src/app/rent/[slug]/rent-client.tsx:170
MEDIUM js-unescaped-html-sink src/app/rss/rss-content.tsx:615
MEDIUM js-open-redirect src/app/vod/[slug]/vod-client.tsx:134
MEDIUM js-open-redirect src/app/watch/[slug]/watch-client.tsx:129
MEDIUM js-unescaped-html-sink src/app/youtube/youtube-content.tsx:546
MEDIUM js-open-redirect src/components/account/iptv-subscription-section.tsx:135
MEDIUM js-open-redirect src/components/account/iptv-subscription-section.tsx:167
MEDIUM js-unescaped-html-sink src/components/news/news-section.tsx:361
MEDIUM js-unescaped-html-sink src/components/news/news-section.tsx:734
MEDIUM redos-nested-quantifier src/lib/metadata-enrichment/metadata-enrichment.ts:317
LOW tls-verification-disabled docs/tunein (2).py:34
LOW tls-verification-disabled docs/tunein (2).py:37
LOW py-xpath-injection docs/tunein (2).py:37
LOW tls-verification-disabled docs/tunein (2).py:47
LOW py-xpath-injection docs/tunein (2).py:47
LOW tls-verification-disabled docs/tunein.py:34
LOW tls-verification-disabled docs/tunein.py:37
LOW py-xpath-injection docs/tunein.py:37
LOW tls-verification-disabled docs/tunein.py:47
LOW py-xpath-injection docs/tunein.py:47

…and 49 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

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