tracker
All repositories: gitoria
24.1 KB
// lib/shows.hl — READ-ONLY data access for a show's page (tracker.worldapi.org#4): shows, seasons,// episodes, persons, genres (storage/mpackdb/, migrated by tools/migrate.hl, tracker.worldapi.org#2).// Kept apart from watches.hl (the per-user watch state) and from components/show.hl (the page itself)// so /unwatched and /schedule (tickets #5/#6, "reuse, don't copy") can import the same functions.//// No declared index beyond the migration's own ['!oldId'] (opening a table with indexes it wasn't// created with is untested territory, hybriel#21 "opening a table rewrites its files") — a slug// lookup is a linear scan of ~9500 shows, cheap for one page load.import { MPackDB } from 'hl:mpackdb'import { exists } from 'hl:fs'import { storageDir, postersDir, hasId } from './util.hl'static genresTable = new MPackDB(file = storageDir + '/genres.db', primaryKey = '@id', indexes = ['!oldId'])static personsTable = new MPackDB(file = storageDir + '/persons.db', primaryKey = '@id', indexes = ['!oldId'])static showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])static seasonsTable = new MPackDB(file = storageDir + '/seasons.db', primaryKey = '@id', indexes = ['!oldId'])static episodesTable = new MPackDB(file = storageDir + '/episodes.db', primaryKey = '@id', indexes = ['!oldId'])// the show with this urlSegment (slug), or null. tracker#28: by a slug → id map (one scan, at the first call) — the old scan of// every record per call (twice per show page) decoded every title's cast + crew: 82 ms per call on the live copy before the// credits, growing with them. A slug the map does not know (a title added since: import, filmography) costs one scan as before// and is remembered; slugs never change. (Flat static written key by key, like people.hl's maps.)// tracker#31 (mission 026): a MERGED title's slug (a tombstone's, below) and a keeper's former slug (`oldSlugs`) answer the// KEEPER — several records can share one slug (migrated duplicates did), so each slug has a rank: a live record's own slug (3)// beats a live record's former one (2) beats a tombstone's (1).static slugIds = {}static slugRank = {}static slugIdsBuilt = { yes = false }// ---- merged titles (tracker#31, mission 026, merge.hl) ----------------------------------------------------------------------// The old tracker left 68 titles as 2–6 records each (same type + TMDB id). The repair (merge.hl) keeps ONE record (the keeper)// and turns the others into TOMBSTONES — never deleted: `mergedInto` = the keeper's id, `mergedTmdbId` (their `tmdbId` is// null, so nothing looks them up by it), `mergedSeasons` (their `seasons` are empty). Every list skips them (isPublicTitle),// every job skips them, a tombstone's slug and short id lead to the keeper.static isMerged = (&show) => { return show != null && show.mergedInto != null }// the record a page shows for this one: the keeper of a tombstone (a chain is followed, at most 5 steps), else itselfstatic liveShowOf = (&show) => {let s = showlet n = 0while (s != null && s.mergedInto != null && n < 5) {s = showsTable.fetch(s.mergedInto)n = n + 1}return s}static holdsSlug = (&s, &slug) => { return s.urlSegment == slug || (s.oldSlugs != null && s.oldSlugs.includes(slug)) }// this record's slugs into the map (at the build, and by merge.hl after a merge changed a record)static noteSlugsOf = (&s) => {live = s.mergedInto == nullmine = []if (s.urlSegment != null) { mine.push({ slug = s.urlSegment rank = live ? 3 : 1 }) }if (live && s.oldSlugs != null) { for (o of s.oldSlugs) { mine.push({ slug = o rank = 2 }) } }for (m of mine) {let cur = slugRank[m.slug]if (cur == null || m.rank >= cur || slugIds[m.slug] == s.id) {slugIds[m.slug] = s.idslugRank[m.slug] = m.rank}}return null}static ensureSlugIds = () => {if (!slugIdsBuilt.yes) {for (s of showsTable.find(null, null)) { noteSlugsOf(s) }slugIdsBuilt.yes = true}return true}static showBySlug = (&slug) => {if (slug == null || hlTypeName(slug) != 'String' || slug == '') { return null }ensureSlugIds()id = slugIds[slug]if (id != null) {hit = showsTable.fetch(id)if (hit != null && holdsSlug(hit, slug)) { return liveShowOf(hit) }}let found = nullfor (s of showsTable.find(null, null)) {if (holdsSlug(s, slug) && (found == null || (found.mergedInto != null && s.mergedInto == null))) { found = s }}if (found != null) {noteSlugsOf(found)return liveShowOf(found)}return null}// project.hl at boot: every slug that is not a live title's own any more (a tombstone's, a keeper's former one) → the keeper's// page, [{ slug, path }] — answered with a 301 (a component route cannot redirect; project.hl slugMoved asks `movedPathOf`)static movedPaths = {}static movedSlugs = () => {ensureSlugIds()out = []for (slug of slugRank.keys()) {if (slugRank[slug] < 3) {let keeper = liveShowOf(showsTable.fetch(slugIds[slug]))if (keeper != null && keeper.mergedInto == null && keeper.urlSegment != null && keeper.urlSegment != slug) {let to = titlePath(keeper)out.push({ slug = slug path = to })movedPaths['/movies/' + slug] = tomovedPaths['/series/' + slug] = to}}}return out}static movedPathOf = (&path) => { return path != null ? movedPaths[path] : null }static genreById = (&id) => { return id == null ? null : genresTable.fetch(id) }// /genres/<genre> (mission 058): the genre with this urlSegment ('Action', 'Sci-Fi-Fantasy'), exact first, else ignoring case// — a scan of the genres table (27 rows)static genreBySlug = (&slug) => {if (slug == null || hlTypeName(slug) != 'String' || slug == '') { return null }lower = slug.toLowerCase()let loose = nullfor (g of genresTable.find(null, null)) {if (g.urlSegment == slug) { return g }if (loose == null && g.urlSegment != null && ('' + g.urlSegment).toLowerCase() == lower) { loose = g }}return loose}static personById = (&id) => { return id == null ? null : personsTable.fetch(id) }static seasonById = (&id) => { return id == null ? null : seasonsTable.fetch(id) }static showById = (&id) => { return id == null ? null : showsTable.fetch(id) }static episodeById = (&id) => { return id == null ? null : episodesTable.fetch(id) }// EVERY show / episode (tracker.worldapi.org#13, catalog.hl): read ONCE when the app starts, to build the public lists —// never per requeststatic allShows = () => { return showsTable.find(null, null) }static allEpisodes = () => { return episodesTable.find(null, null) }// insertion sort, hand-written (no list sort(), hybriel#1) — a show has a handful of seasons at moststatic insertDesc = (&sorted, &s) => {out = []let inserted = falsefor (x of sorted) {if (!inserted && s.seasonNumber >= x.seasonNumber) { out.push(s) inserted = true }out.push(x)}if (!inserted) { out.push(s) }return out}static insertAsc = (&sorted, &e) => {out = []let inserted = falsefor (x of sorted) {if (!inserted && e.episodeNumber <= x.episodeNumber) { out.push(e) inserted = true }out.push(x)}if (!inserted) { out.push(e) }return out}// a show's seasons, latest (highest seasonNumber) first — creator: "all seasons in reverse order,// latest on top"static seasonsOfShow = (&show) => {let sorted = []for (id of show.seasons) {let s = seasonsTable.fetch(id)if (s != null) { sorted = insertDesc(sorted, s) }}return sorted}// a season's episodes, in episode-number orderstatic episodesOfSeason = (&season) => {let sorted = []for (id of season.episodes) {let e = episodesTable.fetch(id)if (e != null) { sorted = insertAsc(sorted, e) }}return sorted}// ---- labels shared by every list (tracker.worldapi.org#8) -------------------------------------static pad2 = (&n) => {let s = '' + nwhile (s.length < 2) { s = '0' + s }return s}// an episode as `S01E01` (creator: "write it like that: S01E01") — /my/shows, /my/unwatched, /my/schedulestatic episodeCode = (&seasonNumber, &episodeNumber) => { return 'S' + pad2(seasonNumber) + 'E' + pad2(episodeNumber) }// the show's year: `year`, else the first 4 characters of `release` ('YYYY-MM-DD'; 197 migrated shows have// no year, a few of those an empty release) — null when neither gives onestatic showYear = (&show) => {if (show.year != null) { return '' + show.year }if (show.release != null && hlTypeName(show.release) == 'String' && show.release.length >= 4) { return show.release.slice(0, 4) }return null}// a show's title as every list shows it: `Doctor Who (2005)` (creator: so same-named shows can be told apart)static titleWithYear = (&show) => {y = showYear(show)return y != null ? show.title + ' (' + y + ')' : show.title}// ---- the description (tracker#18) ---------------------------------------------------------------// creator: "i put the summary in an own field for tmdb because some summaries i wanted to rewrite ... in that case the summary// has priority over maze or tmdb" — `summary` (the creator's own text, never written by the sync), else TMDB's `tmdbSummary`,// else TVmaze's `tvmazeSummary` (HTML stripped); '' when nonestatic hasText = (&v) => { return v != null && hlTypeName(v) == 'String' && v.trim() != '' }static summaryOf = (&show) => {if (show == null) { return '' }if (hasText(show.summary)) { return show.summary }if (hasText(show.tmdbSummary)) { return show.tmdbSummary }if (hasText(show.tvmazeSummary)) { return show.tvmazeSummary }return ''}// ---- a series' status (tracker#35, mission 030) -----------------------------------------------------------------------// The page's status pill (components/show.hl) next to a series' or show's title: TVmaze's `tvmazeStatus` (Running, Ended, To Be// Determined, In Development — stored by the sync and backfill.hl's status backfill) when there is one — creator: "this was also// something tvmaze was better updated about" — else TMDB's `status` (Returning Series, In Production, Planned, Pilot, Ended,// Canceled). TVmaze has no "canceled": its Ended + TMDB's Canceled shows Canceled (the same state, TMDB's word says more).// { text, tone } — tone running | pending | ended | canceled | other (the pill's colour, styles.hl); text '' = no pill (a movie,// or no status known).static statusTones = { 'Running' = 'running' 'Returning Series' = 'running' 'To Be Determined' = 'pending' 'In Development' = 'pending''In Production' = 'pending' 'Planned' = 'pending' 'Pilot' = 'pending' 'Ended' = 'ended' 'Canceled' = 'canceled' }static statusOf = (&show) => {if (show == null || show.type == 'movie') { return { text = '' tone = '' } }let word = hasText(show.tvmazeStatus) ? show.tvmazeStatus : (hasText(show.status) ? show.status : '')if (word == 'Ended' && show.status == 'Canceled') { word = 'Canceled' }if (word == '') { return { text = '' tone = '' } }tone = statusTones[word]return { text = word == 'Returning Series' ? 'Returning' : word tone = tone != null ? tone : 'other' }}// ---- adult titles (mission 054) -----------------------------------------------------------------// `adult` on every title: true / false from TMDB, null = not known yet (the migrated rows; the app's backfill, backfill.hl// `backfillTitle`, asks TMDB). The PUBLIC lists (catalog.hl: homepage rows, /movies, /shows) and the search (search.hl) show// ONLY a title TMDB says is not adult — unknown counts as hidden. A title the user follows stays on /my/* and its page.// A merged tombstone (tracker#31) is never public.static isPublicTitle = (&show) => { return show != null && show.adult == false && show.mergedInto == null }// ---- incomplete titles (tracker.worldapi.org#26; details.hl completes them, credits.hl and dailysync.hl skip them) ------------// COMPLETE = TMDB's details answer went through this app once: completed (`detailsAt`, details.hl) or synced (`tmdbSync`, the// last step of sync.hl's sync — the daily run, a search import) — or given up on (`detailsCheck`: TMDB 404 / adult).// INCOMPLETE = every other title with a TMDB id: a filmography title (`minimal`, #26) until it is completed, an import whose// sync never finished, and (tracker#33, mission 029) the old tracker's MIGRATED rows that were never synced — #26 only looked// at `minimal`/`imported`, so they passed: live copy 2026-10-03, 5,697 non-adult titles (4,206 movies, 1,491 series), 691// series without a single season, 209 + 84 without a poster, 389 + 120 without genres (tools/count-incomplete.hl). Also a// movie with a TV answer's leftovers (below). What a title still lacks that a page shows: `missingParts`.static isIncomplete = (&s) => {return s != null && s.tmdbId != null && s.detailsCheck == null&& ((s.detailsAt == null && (s.minimal == true || s.tmdbSync == null)) || hasTvLeftovers(s))}// tracker#33: what a title's page would miss — the parts a complete record has when TMDB has them: 'poster', 'summary',// 'genres', 'cast', 'ids' (no IMDb id), 'release', 'seasons' (a series without any). The repair does these titles first// (details.hl detailsRepairQueue); tools/count-incomplete.hl counts them. A complete title can still miss one — TMDB has none// (The Remaining, a 7-minute Finnish short: no poster, no IMDb id on TMDB).static missingParts = (&s) => {out = []if (s.image == null || s.image == '') { out.push('poster') }if (summaryOf(s) == '') { out.push('summary') }if (s.genres == null || s.genres.length == 0) { out.push('genres') }if (s.cast == null || s.cast.length == 0) { out.push('cast') }if (s.imdbId == null) { out.push('ids') }if (s.release == null || s.release == '') { out.push('release') }if (s.type != 'movie' && (s.seasons == null || s.seasons.length == 0)) { out.push('seasons') }return out}// mission 025 (report 021's "wrong TMDB id"): the #9 sync once asked TMDB for every followed title as `/tv/<tmdbId>` — a movie's// id is ANOTHER title there (fixed in mission 006: movies go to /movie/) and the TV title's overview, status and season/episode// counts were stored on the movie. On the real data only Star Trek: First Contact: its tmdbId 199 IS the movie (/movie/199),// tmdbSummary was TV 199's ("Kabuhayang Swak na Swak …"), status 'Ended', seasonsCount/episodesCount 0. The movie path never// writes the counts, so a movie that has them is such a record: the repair asks /movie/<id> again (withDetailsFields: overview →// tmdbSummary, status, …) and firstStep drops the counts — repaired once, then it no longer matches.static hasTvLeftovers = (&s) => { return s.type == 'movie' && (s.seasonsCount != null || s.episodesCount != null) }// ---- the kind of a title (tracker.worldapi.org#21, mission 068) ----------------------------------------------// A TV title (`type = 'series'`) is either a SERIES (TMDB's TV type Scripted, Miniseries, Documentary) or a SHOW (Reality,// Talk Show, News, Video — or one of our genres Reality / Talk / News, whatever the type). Stored on the title as `kind`// ('series' | 'show') and TMDB's type as `tmdbType`: by the kind backfill (backfill.hl `kindTitle`, one TMDB request per// title without a show genre), the daily sync and the search import. Until a title has `kind`, its genres decide (no// type known yet = series). Movies are `type = 'movie'` and have no kind.static showTmdbTypes = ['Reality', 'Talk Show', 'News', 'Video']static showGenreNames = ['Reality', 'Talk', 'News']static showGenreIdsOf = () => {out = {}for (g of genresTable.find(null, null)) { if (g.name != null && showGenreNames.includes('' + g.name)) { out[g.id] = true } }return out}// the genre ids that make a title a show — read once (the genres table never changes while the app runs)static showGenreIds = showGenreIdsOf()static hasShowGenre = (&genres) => {if (genres == null) { return false }for (g of genres) { if (showGenreIds[g] == true) { return true } }return false}// 'show' | 'series' from TMDB's type (null = not known) and the title's genre idsstatic kindOfTitle = (&tmdbType, &genres) => {if (hasShowGenre(genres)) { return 'show' }if (tmdbType != null && showTmdbTypes.includes('' + tmdbType)) { return 'show' }return 'series'}// 'movie' | 'series' | 'show' of a stored titlestatic titleKind = (&show) => {if (show.type == 'movie') { return 'movie' }if (show.kind == 'show' || show.kind == 'series') { return show.kind }return kindOfTitle(show.tmdbType, show.genres)}// a title's own page: /movies/<slug>, /series/<slug>, /shows/<slug> (the old /shows/<slug> of a movie or series answers 301,// project.hl showsRoute)static titlePath = (&show) => {k = titleKind(show)return (k == 'movie' ? '/movies/' : (k == 'show' ? '/shows/' : '/series/')) + show.urlSegment}// `/shows/<slug>` (#21, mission 068; project.hl showsRoute): since the split only the game / reality / talk / news SHOWS live// there — the page a series or a movie answers with a 301 instead (its own page), as does a merged duplicate's slug or a// keeper's former one (tracker#31: the keeper's page); null = render the title page here (a show, or an unknown slug)static showsMovedPath = (&slug) => {show = showBySlug(slug)return show != null && (titleKind(show) != 'show' || show.urlSegment != slug) ? titlePath(show) : null}// tracker.worldapi.org#20: the type word of a page heading / list label and its colour class (styles.hl `type-*`)static kindWord = (&kind) => { return kind == 'movie' ? 'Movie' : (kind == 'show' ? 'Show' : 'Series') }static typeWordOf = (&show) => { return kindWord(titleKind(show)) }static typeClassOf = (&show) => { return 'type-word type-' + titleKind(show) }// the poster file name (oldId + the migrated extension) — null when either is missing; served at// /posters/<name> (images.hl), which falls back to a placeholder when the file itself isn't there// yet (the real poster files are not part of the mongo export, see the report's `open`)static posterName = (&show) => {if (show.oldId == null || show.image == null || show.image == '') { return null }return show.oldId + '.' + show.image}// the poster's URL for a LIST (/my/shows, tracker.worldapi.org#8): `/posters/<name>` only when the file really// is in storage/mpackdb/posters/ (images.hl serves the same folder), else the ONE placeholder URL// `/posters/none` — the real data has no poster files yet, and 128 different URLs all answering the same// placeholder were 128 requests per page load (the browser can't cache them as one)static posterUrlOf = (&show) => { return posterUrlOfName(posterName(show)) }static posterUrlOfName = (&name) => { return name != null && exists(postersDir + '/' + name) ? '/posters/' + name : '/posters/none' }// ---- slim per-title caches for the lists (tracker.worldapi.org#30, mission 025) ------------------------------------// /my/series took 4.4 s on a process that had run the first-start jobs (0.4 s fresh): every load fetched each followed title's// WHOLE record (cast + crew, up to 300 entries) and one episode per watch (11.7k fetches); /my/unwatched every season and// episode of every followed title. Each fetch decodes a new object, and with a big live heap (after the jobs) every byte// allocated feeds the byte-triggered GC. Now a list reads two small cached things per title:// - `cardOf(id)`: { id type kind title year titleYear href posterName } — what a row shows;// - `episodeRowsOf(id)`: every episode of the title as { id s e title release }, seasons latest first, episodes in order// (the same order as seasonsOfShow/episodesOfSeason);// - `episodeKeyOf(id)`: one episode as { show s e } — /my/series' last watched episode goes by the WATCHED episode's own// `show` (as before): migrated episodes the sync left outside the title's seasons (a duplicate season, e.g. Reacher S03 on// the real data) still count. project.hl warms every watched episode at boot.// Filled at the first ask (project.hl warms the followed titles at boot) and kept in sync by catalog.hl `refreshCatalogShow`,// which every writer of a title already calls after it changed one (daily sync, repair, kinds, adult backfill, imports):// it calls `refreshTitleCaches(show)`, which rebuilds the entries that exist. Cached values are only ever RETURNED from a// function (a `let x = map[k]` deep-copies the value; a return does not — measured: 3.7 ms per 20k-row copy).static cardCache = {}static episodeRowsCache = {}static episodeKeyCache = {}static cardFrom = (&show) => {y = showYear(show)return {id = show.id type = show.type kind = titleKind(show) title = show.title year = y != null ? y : ''titleYear = titleWithYear(show) href = titlePath(show) posterName = posterName(show)}}static cardOf = (&id) => {if (id == null) { return null }if (cardCache[id] != null) { return cardCache[id] }show = showsTable.fetch(id)if (show == null) { return null }cardCache[id] = cardFrom(show)return cardCache[id]}static episodeRowsFrom = (&show) => {out = []if (show.seasons == null) { return out }// loop names apart from the row's own `s`/`e` keys: inside an object literal a key set earlier shadows the variablefor (sn of seasonsOfShow(show)) {for (ep of episodesOfSeason(sn)) {out.push({ id = ep.id s = ep.seasonNumber e = ep.episodeNumber title = ep.title != null ? ep.title : '' release = ep.release })}}return out}static episodeRowsOf = (&id) => {if (id == null) { return [] }if (episodeRowsCache[id] != null) { return episodeRowsCache[id] }show = showsTable.fetch(id)if (show == null) { return [] }episodeRowsCache[id] = episodeRowsFrom(show)return episodeRowsCache[id]}// an episode that is not stored is { show = null } (never fetched again)static episodeKeyOf = (&id) => {if (id == null) { return { show = null s = null e = null } }if (episodeKeyCache[id] != null) { return episodeKeyCache[id] }ep = episodesTable.fetch(id)episodeKeyCache[id] = ep != null ? { show = ep.show s = ep.seasonNumber e = ep.episodeNumber } : { show = null s = null e = null }return episodeKeyCache[id]}// a title changed (catalog.hl refreshCatalogShow): its cached entries again from the stored record; the episode keys of its// episodes from the new rows (numbers the sync changed). Keys of a title nobody follows (no rows cached) are not refreshed —// /my/series only reads followed titles, and warmTitleCaches covers every followed one at boot.static refreshTitleCaches = (&show) => {if (cardCache[show.id] != null) { cardCache[show.id] = cardFrom(show) }if (episodeRowsCache[show.id] != null) {episodeRowsCache[show.id] = episodeRowsFrom(show)sid = show.idfor (r of episodeRowsOf(sid)) {if (episodeKeyCache[r.id] != null) { episodeKeyCache[r.id] = { show = sid s = r.s e = r.e } }}}return null}// project.hl at boot: the titles anyone follows and every watched episode, so the first /my/ load after a start is not the one// that fills themstatic warmTitleCaches = (&ids) => {let n = 0for (id of ids) {if (cardOf(id) != null) { episodeRowsOf(id) n = n + 1 }}return n}static warmEpisodeKeys = (&ids) => {for (id of ids) { episodeKeyOf(id) }return ids.length}// merge.hl (tracker#31): an episode that moved to another title — its key is read again at the next askstatic forgetEpisodeKey = (&id) => {episodeKeyCache[id] = nullreturn null}// ---- the show on other sites (tracker.worldapi.org#12) ------------------------------------------// the header's link icons: TMDB, IMDb, TheTVDB, TVmaze — ONLY for the ids the show has; a movie (`type = 'movie'`)// gets TMDB + IMDb. TheTVDB's id form is `/dereferrer/series/<id>` (checked 2026-10-01: it and the old// `?tab=series&id=` both 301 to the slug page); the others are the sites' own id URLs (they too 301 to a slug).static externalLinksOf = (&show) => {out = []movie = show.type == 'movie'if (hasId(show.tmdbId)) { out.push({ site = 'tmdb' label = 'TMDB' title = 'On TMDB' href = 'https://www.themoviedb.org/' + (movie ? 'movie/' : 'tv/') + show.tmdbId }) }if (hasId(show.imdbId)) { out.push({ site = 'imdb' label = 'IMDb' title = 'On IMDb' href = 'https://www.imdb.com/title/' + show.imdbId + '/' }) }if (!movie && hasId(show.tvdbId)) { out.push({ site = 'tvdb' label = 'TVDB' title = 'On TheTVDB' href = 'https://thetvdb.com/dereferrer/series/' + show.tvdbId }) }if (!movie && hasId(show.tvmzId)) { out.push({ site = 'tvmaze' label = 'TVmaze' title = 'On TVmaze' href = 'https://www.tvmaze.com/shows/' + show.tvmzId }) }return out}
Branches
- mainmain branch
Latest commits
- b10f00c8tracker#39: double episodes — migrated episodes whose TMDB id TMDB replaced are adopted by their number in the sync (old id -> migratedTmdbId); merge.hl step 3 merges each season's doubles at start (keeper: most watches > synced > first; watches moved/parked; tombstones into mergedEpisodes, nothing deleted); tools/count-duplicate-episodes.hl; gate fixture + paths-m039; live copy 850 -> 0 in 64 s; gates 373/0, 32/0, 52/0mre
- 8751adb8tracker: report 032mre
- 9bce1f65tracker mission 032: STATUS gate files + the hour-boundary flakemre
- 718bfb89tracker#37 (mission 032): /people = everyone, last updated first (updatedAt stamped by the person fill; view built at boot, touched people first at once), photo + name tiles (person colour) with the /movies pagination, /people/<letter> removed; photo = our file, tmdbProfile, a cast/crew entry's profile (in-memory map at boot), else the new 'no photo' placeholder; new cast/crew/created_by people keep tmdbProfile; search people rows with the photo; /settings = the heading only; util.hl sortDesc starts from sorted runs (same result, 105k: 1.6 s -> 0.15 s); gates 369/0, 32/0, 52/0, check-theme 0; README/STATUS/LOGmre
- 96ba683adeploy.sh: a gate without a 'passed,' line (check-theme) no longer ends the scriptmre
- eb3b9205tracker: report 031mre
- 9b5d2e89tracker mission 031: README (What it does, Test: four gates + the #32 checks, Files: theme/, new pages), STATUS (real copy, A/B load, how to repeat, open points), LOGmre
- 39950e4ctracker#32 (mission 031): the WorldAPI theme (theme/ vendored verbatim from layouts.worldapi.org 85b5654; styles.hl inherits it: accent green-dark, type colours 1-6; own base/header rules, row lines, genre-pill and inverted-button frames removed, the season foldable keeps its line; check-theme 21 -> 0, 4th deploy gate; main actions class primary) and the #32 header (theme AppHeader/MainMenu/UserMenu/Sidebar/ContentFirst: desktop brand, search, Series|Shows|Movies|Genres|People, user icon with Unwatched..Settings, Logout; signed out the ident selector, phone the iD icon dropdown; phone menu in the sidebar overlay; marked entry by :has); /find -> /search/<q>, /genres, /people(/<letter>), /settings; main { ContentFirst { slot } } works around the hl:web one-line slot bug; gates 365/0, 32/0, 52/0, check-theme 0mre
- a386dc92tracker: reports 029 + 030mre
- 71e0fd7dtracker missions 029 + 030: README (What it does, Files, gate count), STATUS (real-copy numbers, how to repeat, open points), LOGmre
- d36ea6eatracker#34 + #35 (mission 030): Follow directly under the poster, as wide as the poster (show.hl, styles.hl); the status pill next to a series' title — TVmaze's status (new tvmazeStatus, stored by the sync's TVmaze merge) else TMDB's, TVmaze Ended + TMDB Canceled = Canceled, inverted (filled, dark text, no border), green running / yellow pending / red canceled / muted ended (shows.hl statusOf); the daily delta asks TVmaze's status of an unfollowed series TVmaze's change list names (dailysync.hl syncRunStep, sync.hl syncTvmazeStatus); the status backfill after the details repair (backfill.hl, jobs.hl statusTick; resumable, 550 ms per TVmaze request); gates 354/0, 32/0, 52/0mre
- 7d7d4487tracker#33 (mission 029): reduced titles — every title TMDB's details never went through this app (no detailsAt, no tmdbSync) is incomplete (shows.hl isIncomplete; the old tracker's migrated rows passed #26's test: 5,697 non-adult on the live copy, 691 series without seasons); the repair job does the visibly reduced first (shows.hl missingParts), the page completes one on open; a title TMDB has no poster for (The Remaining) shows the placeholder; tools/count-incomplete.hl; gate fixtures stand for synced titles (tmdbSync), tests/seed-reduced.hl + #33 checks; gates 347/0, 32/0, 52/0mre
- 661c2592tracker: report 028mre
- 27c916fatracker mission 028: README ("Code order", the new file map), STATUS (counts before/after, tests, how to repeat, open), LOGmre
- d924f398tracker mission 028: comments name the new files (sync.hl, dailysync.hl, backfill.hl, credits.hl, jobs.hl, images.hl …); tools/ref-params.py + tools/lambda-audit.py also scan lib/ (they globbed the root only), lambda-audit counts a plain `x = p` alias like `let x = p`mre
- 2e89b968tracker mission 028 (code order) 5/5 let: `let` only where a variable is reassigned — 667 never-reassigned lets became plain declarations (project.hl, lib/, components/, tools/, tests/); kept: 264 in loop bodies (a plain declaration there is 'Cannot reassign' on the 2nd pass), 234 reassigned, 27 whose name is also a member/outer/free name (a plain write would rebind it); tools/let-audit.py decides and fixes (README 'Code order'); tests/realdata-m028.{sh,mjs} = the page-output diff on a real copy; gates 342/0, 32/0, 52/0, real-copy pages identicalmre
- 54796ff2tracker mission 028 (code order) 4/5 thin faces + last copies: the show page's check/follow faces call lib/watches.hl toggleWatched / toggleSeasonWatched (seasonAllWatched moved there) and lib/follows.hl toggleFollowed; both logins (header selector face, /login/callback) share lib/users.hl userOfCode; todayStr/listOf copies in components and the export readers copied into tools/migrate.hl + tools/old-short-ids.hl now once (lib/util.hl, lib/export.hl); gates 342/0, 32/0, 52/0; old-short-ids output byte-identical, migrate output identicalmre
- 06b078e3tracker mission 028 (code order) 3/5 project.hl is the map: config, routes, wiring and a feature → file index (914 → 258 lines); the background jobs (daily sync run, backfills, details repair, credits job, merge, short ids, collection seed) moved unchanged into lib/jobs.hl (a class: their state is reassigned every step, a static cannot be; one instance made after the server), the login callback into lib/users.hl, poster/photo serving into lib/images.hl, the /shows/<slug> rule into lib/shows.hl showsMovedPath; route handlers are thin wrappers; gates 342/0, 32/0, 52/0, real-copy pages identicalmre
- 94716fd2tracker mission 028 (code order) 2/5 util + topics: lib/util.hl holds envOr, storageDir, postersDir, profilesDir, newId, hexDigits, todayStr, dateOr, textOr, hasId, listOr, firstOf, sortDesc once (were copied into up to 5 files); tmdbsync.hl split into tmdb.hl (TMDB/TVmaze requests), sync.hl (one title's sync), sync-helpers.hl, backfill.hl; details.hl split into details.hl, credits.hl, credits-helpers.hl (isIncomplete to shows.hl); search-helpers.hl (words, query, ranking, slugs); collections.hl (the TMDB collection seed, out of franchises.hl); deltasync.hl renamed dailysync.hl; no behaviour change: gates 342/0, 32/0, 52/0, real-copy pages identicalmre
- 186079b0tracker mission 028 (code order) 1/5 move: every root .hl except project.hl into lib/ (styles.hl into components/), import paths only; gates 342/0, 32/0, 52/0; real-copy pages identicalmre