tracker
All repositories: gitoria
2.9 KB
// tools/tvmaze-types.hl — tracker#43 (mission 037): TVmaze's TYPE for every series that has a TVmaze id but no stored type, and// which titles that moves from /series to /shows (Variety, Talk Show, Game Show, Reality, News, Panel Show, Award Show, Sports —// shows.hl kindOfTitle). The SAME step the app's TVmaze status backfill runs after the deploy (backfill.hl tvmazeStatusTitle:// GET <TVMAZE_BASE_URL>/shows/<id>, one request per series, 550 ms apart — TVmaze allows 20 / 10 s; no TMDB token needed).// ONLY on a COPY or with the app stopped (opening a table rewrites its files; hl:mpackdb: one process per storage):// TRACKER_STORAGE=/abs/path/storage/mpackdb ./bin/hybriel tools/tvmaze-types.hl [--limit N]// Prints one line per title whose kind changed ("moved: …") and the totals: series asked, types stored, moved to shows, moved to// series, the TVmaze types seen, errors. Idempotent: a second run asks nothing (every series has its type, '' = TVmaze gave none).import { env, args, exit } from 'hl:proc'import { now, sleep } from 'hl:time'import { pauseMsAfter } from '../lib/tmdb.hl'import { tvmazeStatusQueue, tvmazeStatusTitle } from '../lib/backfill.hl'import { showById, titleKind, titlePath } from '../lib/shows.hl'import { persistSync } from '../lib/sync.hl'storageDir = env('TRACKER_STORAGE')if (storageDir == null || !storageDir.startsWith('/')) { console.log('REFUSED: set TRACKER_STORAGE, absolute (app stopped, or a copy)') exit(2) }argv = args()let limit = -1let i = 0while (i < argv.length) {if (argv[i] == '--limit' && i + 1 < argv.length) { limit = toNumber(argv[i + 1]) }i = i + 1}started = now()queue = tvmazeStatusQueue()console.log('tvmaze types: ' + queue.length + ' series with a TVmaze id and no TVmaze type or status')types = {}let asked = 0let stored = 0let toShows = 0let toSeries = 0let errors = 0for (id of queue) {if (limit < 0 || asked < limit) {let r = tvmazeStatusTitle(id)asked = asked + 1if (r.type != null) {stored = stored + 1types[r.type] = types[r.type] == null ? 1 : types[r.type] + 1}if (r.error != '') { errors = errors + 1 console.log('error: ' + r.error) }if (r.moved) {let s = showById(id)let k = titleKind(s)if (k == 'show') { toShows = toShows + 1 } else { toSeries = toSeries + 1 }console.log('moved: ' + s.title + ' (' + s.year + ') TVmaze ' + s.tvmzId + ' type ' + r.type + ', TMDB type ' + s.tmdbType + ' → ' + titlePath(s))}if (asked % 25 == 0) { persistSync() }if (asked % 100 == 0) { console.log('tvmaze types: ' + asked + '/' + queue.length + ' asked, ' + toShows + ' moved to shows') }sleep(pauseMsAfter(r) / 1000)}}persistSync()let seen = ''for (t of types.keys()) { seen = seen + (seen == '' ? '' : ', ') + t + ' ' + types[t] }console.log('tvmaze types done: asked=' + asked + ' typesStored=' + stored + ' movedToShows=' + toShows + ' movedToSeries=' + toSeries + ' errors=' + errors + ' seconds=' + ((now() - started) / 1000))console.log('tvmaze types seen: ' + seen)
Branches
Latest commits
- 8d3b0f20widget: the franchise link's 44 px tap area no longer overlaps the Prequel/Sequel rowmre
- 1d98dcfdbrowser gate: the badges' size check reads the padding box (the 44 px tap area is transparent border)mre
- 2f9e29ffreports/MK-mobile.md, deploy.sh GATES: tests/mobile.mjs, theme check markermre
- 7cfc8ab5a season of more than 150 episodes starts closed on its title page; the phone gate checks itmre
- 59095c59tests/mobile.mjs: the phone gate (390 px touch, tap targets, /franchises paging)mre
- 105309detap targets: every row link, the TMDB/IMDb badges, the widget links, the franchise names and the login-failed link are 44 px high on a phonemre
- f0b86c8efranchises: 40 loose timelines per page (/franchises/page/N) and a merge sort for the names (1,546 timelines: 20 s and 54,000 px before)mre
- b9e841a7Merge branch 'sy-sync'mre
- d1ae2701sync components.hybriel 4922f9c: modal and pagination 44 px targets (vendored copies, verbatim) (SY)mre
- 043624b2theme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
- 05d89fd0deploy: security gate (tests/security.mjs)mre
- 2ae8a47bMerge branch 'sk-sec'mre
- 8fee5d52sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
- 944ad51eSK: report reports/SK-sec.md, LOGsk
- 415487c1SK: import budget per user + id type check, gate checkssk
- 7b8a4f74security audit SK: nosniff + image sandbox headers, face id checks, adult follow, login budget + new session at login, guest-link budget, tests/security.mjssk
- f0f26c5areports: T18 section (gates, boot-gate, 3x3 table, search + short-id compare)mre
- 2a8682a1deploy.sh GATES: tests/warmstart.mjsmre
- 3761338breports/T17-boot.md: handoff (phase table, fix, numbers so far, open proof)mre
- 52e09eb2boot: sync window 1000 ms (the gates ask for a complete start), README boot-time sectionmre