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
- e5c9b659Pack retained search IDs into UTF-8 bytesmre
- 62a5f6c7HM67 brief, HM66 mergedmre
- b32b8440Merge hm66-catalogindex: packed catalog indexmre
- 2db0f7adReport HM66 heap measurements and validationmre
- 6ce15623Pack catalog lists and membership maps in UTF-8 bytesmre
- 71134e21HM66 briefmre
- ed4cbab2status timemre
- e982c26dlog: HM65 mergedmre
- 6e72f9d1Merge hm65-fields: episode boot scan reads three fieldsmre
- 07a5c883HM65 report measured field projection and complete validationmre
- 0eab858fRead only catalog date fields during the episode boot scanmre
- d3179273log: HM65 hl:heap vendoringmre
- cb78a1a0HM65 report missing heap diagnostic package with repromre
- 89606a5cHM65 briefmre
- 096ce0d4log: DP69 live on day48mre
- b3d8a80bDP69 brief, RV48 mergedmre
- ce6d7d32Merge rv48: Hybriel day48mre
- 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
- 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
- 4a802ae7status: RV48 runningmre