tracker
All repositories: gitoria
4.4 KB
// tests/seed-status.hl — GATE FIXTURE for tracker#35 (mission 030): written by tests/browser.mjs into the gate's storage while the// app is STOPPED (one process per storage, hybriel#21). Four complete series (synced: `tmdbSync`) with TMDB's status and a TVmaze// id but no TVmaze status yet — the status backfill (backfill.hl tvmazeStatusTitle) asks the fake TVmaze for each:// Running Gate Series TMDB 'Returning Series', TVmaze 5501 'Running' → pill "Returning" (green; mission 033: episodes 10// days ago and in 10 days — outside the ±7 days —// and a SPECIAL (season 0) in 2 days: no "Airing")// Airing Gate Series TMDB 'Returning Series', TVmaze 5503 'Running' → "Airing" (an episode in 3 days)// Aired Gate Series TMDB 'Returning Series', TVmaze 5505 'Running' → "Airing" (an episode 7 days ago: the edge)// Canceled Gate Series TMDB 'Canceled', TVmaze 5502 'Ended' → pill "Canceled" (red: TVmaze has no canceled)// Gone Maze Series TMDB 'Ended', TVmaze 5504 → 404 → `tvmazeStatusCheck`, pill "Ended" (muted)// Pending Gate Series TMDB 'In Production', no TVmaze id → never asked, pill "In Production" (yellow)// Variety Gate Series TMDB type 'Scripted' (a series), TVmaze 5506 'Running', type 'Variety' → #43 (mission 037): a SHOW// once TVmaze's type is stored — moves from /series to /shows (like Saturday Night Live UK)import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'import { now, timestamp } from 'hl:time'storageDir = env('TRACKER_STORAGE')if (storageDir == null || !storageDir.startsWith('/')) { hlError('set TRACKER_STORAGE, absolute') }showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])seasonsTable = new MPackDB(file = storageDir + '/seasons.db', primaryKey = '@id', indexes = ['!oldId'])episodesTable = new MPackDB(file = storageDir + '/episodes.db', primaryKey = '@id', indexes = ['!oldId'])day = (n) => { return timestamp(now() + n * 86400000).slice(0, 10) }// a season with an episode per date (mission 033: Returning vs Airing); returns its idseason = (showId, no, dates) => {sid = showId + 's' + noeps = []let k = 0while (k < dates.length) {let eid = sid + 'e' + kepisodesTable.put({ id = eid episodeNumber = k + 1 seasonNumber = no title = 'Episode ' + (k + 1) summary = null release = dates[k] show = showId season = sid oldId = eid })eps.push(eid)k = k + 1}seasonsTable.put({ id = sid seasonNumber = no title = null release = null summary = null show = showId episodes = eps oldId = sid })return sid}series = (id, tmdbId, name, slug, status, tvmzId) => {return { adult = false id = id title = name summary = 'A #35 fixture.' tmdbSummary = null tmdbId = tmdbIdlanguage = 'en' type = 'series' kind = 'series' release = '2015-01-01' year = 2015 image = null urlSegment = slugepisodesCount = 0 homepage = null imdbId = null seasonsCount = 0 status = status tagline = nulltvdbId = null tvmzId = tvmzId genres = [] cast = [] seasons = [] oldId = 'st-' + tmdbId creditsAt = 1 detailsAt = 1 tmdbSync = 1 }}r1 = series('st00000000000sr1', 1501, 'Running Gate Series', 'running-gate-series', 'Returning Series', 5501)r1.seasons = [season(r1.id, 1, [day(-10), day(10)]), season(r1.id, 0, [day(2)])]showsTable.put(r1)a1 = series('st00000000000sr5', 1505, 'Airing Gate Series', 'airing-gate-series', 'Returning Series', 5503)a1.seasons = [season(a1.id, 1, [day(-30), day(3)])]showsTable.put(a1)a2 = series('st00000000000sr6', 1506, 'Aired Gate Series', 'aired-gate-series', 'Returning Series', 5505)a2.seasons = [season(a2.id, 1, [day(-7)])]showsTable.put(a2)showsTable.put(series('st00000000000sr2', 1502, 'Canceled Gate Series', 'canceled-gate-series', 'Canceled', 5502))showsTable.put(series('st00000000000sr4', 1504, 'Gone Maze Series', 'gone-maze-series', 'Ended', 5504))showsTable.put(series('st00000000000sr3', 1503, 'Pending Gate Series', 'pending-gate-series', 'In Production', null))v1 = series('st00000000000sr7', 1507, 'Variety Gate Series', 'variety-gate-series', 'Returning Series', 5506)v1.tmdbType = 'Scripted'showsTable.put(v1)seasonsTable.persist()episodesTable.persist()showsTable.persist()console.log('seed status: 7 series (TVmaze 5501, 5502, 5503, 5504, 5505, none, 5506)')
Branches
Latest commits
- 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
- c87149e8tests/warmstart.mjs: the progressive start proven over HTTP (note in the window, 503 short id, after: everything); bootBeginmre
- 593a6350boot: resumable start-up scan, the server listens first (T17)mre