gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0553b51f0553b51ftracker#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 + STATUSmre0553b51f/docs/franchises.md

6.1 KB

  1. # Franchises and timelines (tracker.worldapi.org#19, mission 066)
  2. Creator: "we have franchises, and timelines, and some franchises have multiple timelines ... make them sortable by timeline or
  3. release date at shows the release date of the last episode counts. in a show or movie page we show a franchise widget with
  4. < Prequel | TimelineName | Sequel > and if the timeline is part of a franchise that franchise is above it and when you click on
  5. it you get the franchise index." Names: "Franchise", "Timeline"; navigation `/franchises`.
  6. ## Data (`franchises.hl`, new tables — nothing in `shows.db` changes)
  7. | Table | Fields |
  8. |---|---|
  9. | `franchises.db` (`!slug`) | `name`, `slug`, `shortId` (always null for now), `summary`, `created` |
  10. | `timelines.db` (`!slug`) | `name`, `slug`, `franchise` (@id or null), `order` [show @id …] (in-world order), `source` (`tmdb`/`editor`), `tmdbCollection` (TMDB id or null), `created` |
  11. | `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 |
  12. * Slugs like the shows' urlSegment: `Star Trek — Prime` → `Star-Trek-Prime`; taken → `-2`, `-3`; never `edit`.
  13. * A title may be in several timelines → one widget per timeline. `byShow` (show @id → [timeline @id]) is built at start
  14. (`ensureFranchises`, one scan) and kept current by every edit.
  15. * Inspect: the pages (`/franchises` lists every timeline with its count), or a small .hl script opening
  16. `new MPackDB(file = '<copy>/timelines.db', primaryKey = '@id', indexes = ['!slug'])` + `find(null, null)` — ONLY on a copy
  17. or with the app stopped (opening a table rewrites its files, hybriel#40).
  18. ## Ordering
  19. * **Timeline** = `order` as edited (the seed: TMDB collection parts by `release_date`).
  20. * **Release** = a movie's `release`; a SERIES' LAST episode: the newest one already out (≤ today, UTC), else the newest
  21. announced one, else the series' own `release`. No date → last. Equal dates keep the timeline order. Shown per row as
  22. `1996-11-18` / `last episode 2020-06-15`.
  23. * Franchise index: its timelines oldest first (by their earliest release).
  24. * Public like all lists (mission 054): pages and prequel/sequel links skip titles that are not `adult == false`; the editor
  25. shows every title.
  26. ## Pages
  27. | Route | Component | |
  28. |---|---|---|
  29. | `/franchises` | `components/franchises.hl` | franchises (→ index, n timelines), then the timelines without one (TMDB collections) with n titles; creator: "Edit" |
  30. | `/franchises/<slug>` | `components/franchise.hl` | the index: name, summary, each timeline a header (name → its page, count, `Timeline | Release` toggle) + its rows |
  31. | `/timelines/<slug>` | `components/franchise.hl` | one timeline, its franchise above it; creator: "Edit" |
  32. | `/franchises/edit` | `components/franchiseedit.hl` | creator: new franchise (name, summary), new timeline (name → its editor), find a timeline by name |
  33. | `/timelines/<slug>/edit` | `components/timelineedit.hl` | creator: franchise chips (None + all; a tap attaches), rows ↑ ↓ ✕, "Add titles" (search.hl index) |
  34. | 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`) |
  35. The sort toggle is client-only (`flatRows` is pure; both orders come with the page). One flat row list (`head`/`item`
  36. rows) instead of a nested for (hybriel#86).
  37. **Editor = the creator only**: `isEditorSession` = the signed-in user's ident id is in `TRACKER_EDITORS` (default `az5b2`).
  38. Every editing face (`fedCreateFranchise`, `fedCreateTimeline`, `tedSetFranchise`, `tedMove`, `tedRemove`, `tedAdd`) checks it
  39. again server-side; `fedFindTimelines` / `tedSearch` are public reads. Not built: rename/delete of franchises or timelines,
  40. editing a franchise's summary (open point).
  41. ## The seed (TMDB movie collections)
  42. In the app, own `every(0.1)` clock (`project.hl collectionTick` → `franchises.hl seedStep`), ONE movie per step:
  43. 1. `GET /movie/<tmdbId>` → `belongs_to_collection` (none → check row `no collection`; 404 → `TMDB 404`; other failure →
  44. back of the queue, ≤ 2 retries per start).
  45. 2. A collection seen before (`collectionsDone`, from check rows + timelines) → just a check row, no further request.
  46. 3. Else `GET /collection/<id>` → parts sorted by `release_date`, mapped to OUR non-adult movies by tmdbId. **≥ 2 → one
  47. timeline** (`source = 'tmdb'`, no franchise); < 2 → none (`small`). Every matched part gets a check row at once, so its
  48. own details request is never made.
  49. Pause after a step: 260 ms × requests made (≤ 40 / 10 s, like the adult backfill). Waits while the daily sync or the adult
  50. backfill runs. Queue at start = every movie with a tmdbId, `adult != true`, without a check row → resumes after a restart;
  51. nothing to do → one log line. Persisted every `TRACKER_COLLECTIONS_PERSIST_EVERY` (25) steps and at the end. A hand-edited
  52. timeline is never touched. Log: `collections: start, N movies to check`, every `TRACKER_COLLECTIONS_LOG_EVERY` (500)
  53. `collections: pos/N movies, checked= timelines= titles= small= noCollection= notFound= requests= errors= retries= seconds=`,
  54. `collections done: …`. `TRACKER_COLLECTIONS=0` switches it off (off too without `TMDB_READ_TOKEN`).
  55. Re-seed (e.g. after many imports): delete `collectionchecks.db*` with the app stopped — existing collection timelines are
  56. skipped (their `tmdbCollection` is known); NEW parts of an existing collection are not added (open point).
  57. Real data: STATUS.md, ticket #19.
  58. ## Test
  59. * Gate: `tests/franchises.mjs` (own storage `.scratch/franchise-store`, fixture `tests/seed-franchises.hl` on top of
  60. `tests/seed-show.hl`, fake TMDB `collections`): seed + resume + pacing, widget (ends, client-side Sequel click, franchise
  61. above), `/franchises`, index sort both ways (series by last episode), editor only for `TRACKER_EDITORS`, 390/1280 no
  62. sideways scroll, screenshots with `TRACKER_GATE_SHOTS`.
  63. * `tests/browser.mjs` runs with `TRACKER_COLLECTIONS=0` (its fake TMDB request counts must not see the seed).
  64. * Real data: `tests/realdata-066.mjs` (procedure in STATUS.md).

Branches

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