tracker
All repositories: gitoria
6.1 KB
# Franchises and timelines (tracker.worldapi.org#19, mission 066)Creator: "we have franchises, and timelines, and some franchises have multiple timelines ... make them sortable by timeline orrelease date at shows the release date of the last episode counts. in a show or movie page we show a franchise widget with< Prequel | TimelineName | Sequel > and if the timeline is part of a franchise that franchise is above it and when you click onit you get the franchise index." Names: "Franchise", "Timeline"; navigation `/franchises`.## Data (`franchises.hl`, new tables — nothing in `shows.db` changes)| Table | Fields ||---|---|| `franchises.db` (`!slug`) | `name`, `slug`, `shortId` (always null for now), `summary`, `created` || `timelines.db` (`!slug`) | `name`, `slug`, `franchise` (@id or null), `order` [show @id …] (in-world order), `source` (`tmdb`/`editor`), `tmdbCollection` (TMDB id or null), `created` || `collectionchecks.db` | pk = the movie's show @id; `collection` (TMDB id or null), `why` (`collection`, `collection known`, `no collection`, `TMDB 404`, `collection 404`), `at` — the seed's progress |* Slugs like the shows' urlSegment: `Star Trek — Prime` → `Star-Trek-Prime`; taken → `-2`, `-3`; never `edit`.* A title may be in several timelines → one widget per timeline. `byShow` (show @id → [timeline @id]) is built at start(`ensureFranchises`, one scan) and kept current by every edit.* Inspect: the pages (`/franchises` lists every timeline with its count), or a small .hl script opening`new MPackDB(file = '<copy>/timelines.db', primaryKey = '@id', indexes = ['!slug'])` + `find(null, null)` — ONLY on a copyor with the app stopped (opening a table rewrites its files, hybriel#40).## Ordering* **Timeline** = `order` as edited (the seed: TMDB collection parts by `release_date`).* **Release** = a movie's `release`; a SERIES' LAST episode: the newest one already out (≤ today, UTC), else the newestannounced one, else the series' own `release`. No date → last. Equal dates keep the timeline order. Shown per row as`1996-11-18` / `last episode 2020-06-15`.* Franchise index: its timelines oldest first (by their earliest release).* Public like all lists (mission 054): pages and prequel/sequel links skip titles that are not `adult == false`; the editorshows every title.## Pages| Route | Component | ||---|---|---|| `/franchises` | `components/franchises.hl` | franchises (→ index, n timelines), then the timelines without one (TMDB collections) with n titles; creator: "Edit" || `/franchises/<slug>` | `components/franchise.hl` | the index: name, summary, each timeline a header (name → its page, count, `Timeline | Release` toggle) + its rows || `/timelines/<slug>` | `components/franchise.hl` | one timeline, its franchise above it; creator: "Edit" || `/franchises/edit` | `components/franchiseedit.hl` | creator: new franchise (name, summary), new timeline (name → its editor), find a timeline by name || `/timelines/<slug>/edit` | `components/timelineedit.hl` | creator: franchise chips (None + all; a tap attaches), rows ↑ ↓ ✕, "Add titles" (search.hl index) || widget on `/shows/<slug>` | `components/franchisewidget.hl` | composed by `components/show.hl` under the header: franchise above, `‹ Prequel | name | Sequel ›`, the title under each side, a missing side greyed out (`span.off`) |The sort toggle is client-only (`flatRows` is pure; both orders come with the page). One flat row list (`head`/`item`rows) instead of a nested for (hybriel#86).**Editor = the creator only**: `isEditorSession` = the signed-in user's ident id is in `TRACKER_EDITORS` (default `az5b2`).Every editing face (`fedCreateFranchise`, `fedCreateTimeline`, `tedSetFranchise`, `tedMove`, `tedRemove`, `tedAdd`) checks itagain server-side; `fedFindTimelines` / `tedSearch` are public reads. Not built: rename/delete of franchises or timelines,editing a franchise's summary (open point).## The seed (TMDB movie collections)In the app, own `every(0.1)` clock (`project.hl collectionTick` → `franchises.hl seedStep`), ONE movie per step:1. `GET /movie/<tmdbId>` → `belongs_to_collection` (none → check row `no collection`; 404 → `TMDB 404`; other failure →back of the queue, ≤ 2 retries per start).2. A collection seen before (`collectionsDone`, from check rows + timelines) → just a check row, no further request.3. Else `GET /collection/<id>` → parts sorted by `release_date`, mapped to OUR non-adult movies by tmdbId. **≥ 2 → onetimeline** (`source = 'tmdb'`, no franchise); < 2 → none (`small`). Every matched part gets a check row at once, so itsown details request is never made.Pause after a step: 260 ms × requests made (≤ 40 / 10 s, like the adult backfill). Waits while the daily sync or the adultbackfill runs. Queue at start = every movie with a tmdbId, `adult != true`, without a check row → resumes after a restart;nothing to do → one log line. Persisted every `TRACKER_COLLECTIONS_PERSIST_EVERY` (25) steps and at the end. A hand-editedtimeline is never touched. Log: `collections: start, N movies to check`, every `TRACKER_COLLECTIONS_LOG_EVERY` (500)`collections: pos/N movies, checked= timelines= titles= small= noCollection= notFound= requests= errors= retries= seconds=`,`collections done: …`. `TRACKER_COLLECTIONS=0` switches it off (off too without `TMDB_READ_TOKEN`).Re-seed (e.g. after many imports): delete `collectionchecks.db*` with the app stopped — existing collection timelines areskipped (their `tmdbCollection` is known); NEW parts of an existing collection are not added (open point).Real data: STATUS.md, ticket #19.## Test* Gate: `tests/franchises.mjs` (own storage `.scratch/franchise-store`, fixture `tests/seed-franchises.hl` on top of`tests/seed-show.hl`, fake TMDB `collections`): seed + resume + pacing, widget (ends, client-side Sequel click, franchiseabove), `/franchises`, index sort both ways (series by last episode), editor only for `TRACKER_EDITORS`, 390/1280 nosideways scroll, screenshots with `TRACKER_GATE_SHOTS`.* `tests/browser.mjs` runs with `TRACKER_COLLECTIONS=0` (its fake TMDB request counts must not see the seed).* Real data: `tests/realdata-066.mjs` (procedure in STATUS.md).
Branches
- mainmain branch
Latest commits
- 0553b51ftracker#19 (mission 066): franchises and timelines — tables, /franchises, /franchises/<slug>, /timelines/<slug> (Timeline | Release sort, series by last episode), the Prequel | Timeline | Sequel widget with the franchise above, the creator's editor, TMDB collection seed in the app (resumes, paced); gate tests/franchises.mjs 48/0 + browser.mjs 266/0, tests/realdata-066.mjs, docs/franchises.md, README + STATUSmre
- fa1f9dfatracker#29 (mission 063): unwatched check muted grey outline + check (accent only on hover), watched stays solid — no code regression, the accent outline read as ticked; gate checks real checks visibly (computed style + screenshot pixel) on /my/unwatched, show, movie, /my/movies; gate 266, tests/realdata-063.mjs, README + STATUSmre
- d8b12d67tracker#27 (mission 060): short ids for movies, series and persons — old 702 kept (data/old-short-ids.json), new random [a-z0-9]{5} unique across both, claimed at creation, background backfill (resumes), shown under poster/photo, /<shortId> → 301; gate 259, tests/realdata-060*, README + STATUSmre
- f14db671tracker#22-#25 (mission 058): episode air dates, season check = all episodes watched, movie watched check (+ /my/movies count), /genres/<genre> pages (movies + series, newest first, paginated); gate 238, tests/realdata-058.mjs, README + STATUSmre
- 1704ec45tracker#17 (mission 057): season caret down/up, skeleton rows while a season loads, sessionless showSeasonEpisodes face (no page re-mount), client-only close; gate 214, tests/realdata-057.mjs, README + STATUSmre
- f2fe3e36mission 056: README + STATUS (merge, fixes, Hybriel 8590df63, real-data check), tests/realdata-056.mjs, tools/check-public-slugs.hlmre
- f40c250emission 056: re-vendor hybriel master 8590df63 (#121, #122); an adult title's page is Not found for non-followers; gate: leave the page before stopping the servermre
- 2b7fdd6cmission 056: signed-out header one row on phones ("Log in", nowrap), backfill skips adult titles' posters, gate checksmre
- 2c53d5efMerge branch 't16-person' (tracker#16 person pages) into main; filmography shows only public titles (054 adult flag), gate race fix (backfill start line)mre
- c171227emission 054: hide adult/unknown titles from the public lists and the search; in-app adult-flag backfill (TMDB details + poster per title, resumes), gate + real-data proofmre
- 139fafd8tracker#16: short bio (4 lines, click = all), real-data check script, README + STATUSmre
- 93be9476tracker#16: person pages /person/<slug> with the filmography fetched from TMDB on the first visit (step by step), gatemre
- 47a3cae6STATUS: mission 053 merge commit idsmre
- dcc5eecaMerge branch 't14-search'mre
- 03edc783Merge branch 't15-tvmaze'mre
- 71b46345tracker#15: numbering check by date or title, placeholder titles in other languages, docs + real-data proofmre
- 6bb2daf1tracker#13: homepage (tiles, intro, latest movies/shows), /shows, /movies/page/N, /my/movies; lists cached in memorymre
- b8bd1157tracker#14: README + STATUS (search, real-data numbers, gate, merge notes)mre
- 65c694a8tracker#14: search — header magnifier, /search/<text> (in-memory word-prefix index over titles + people), Fetch from web (TMDB search/multi, ours left out), Add = import via syncShow; gate +25 checks, real-data scriptmre
- 34f2c15btracker#15: TVmaze merge in the sync (gaps only: new episodes/seasons, empty titles/air dates; numbering check), fake TVmaze episodes + gatemre