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
- 6d05fa37Log: HM50 Part A mergedmre
- 1c7dab74HM50: the shell reads the framework's online state, netProbe removed (tracker#55)mre
- e8b91697HM50: search address follows the text via navigate(path, replace = true) (tracker#52)mre
- 6fe1896cHM50: re-vendor Hybriel set day50 (source 0ae38232, bin d3ef9d16)mre
- 2f391aa9Log: HM50 startedmre
- 4b59c03dHM50 mission: doc pathmre
- ed526d67HM50 missionmre
- 2f986ca3Log: RT50 passmre
- 1c4715a4RT50 mission: day50 repro retestmre
- 57d1c0dcLog: day50 retest requestmre
- 60b1f419Log: Anton #336 result, wake checkmre
- 919a18aalog: scratchmre
- 6b504440status tidymre
- 9332bd10log: DP70 livemre
- be11daa0DP70 brief fixmre
- 886a7028DP70 brief, HM67 mergedmre
- b41cdd6dMerge hm67-searchids: packed search IDsmre
- 385904eaReport HM67 matched heap measurements and gate proofmre
- e5c9b659Pack retained search IDs into UTF-8 bytesmre
- 62a5f6c7HM67 brief, HM66 mergedmre