tracker
All repositories: gitoria
5.2 KB
// tests/seed-kinds.hl — GATE FIXTURE for tracker.worldapi.org#20/#21 (mission 068, tests/kinds.mjs): TV titles of both kinds,// written into the gate's storage AFTER tests/seed-show.hl, before the server starts. The genres Talk / Reality / News (a title// with one of them is a SHOW from the stored data) and what the fake TMDB says about each title's `type` (tests/kinds.mjs):// 7001 Gate Reacher Drama, type Scripted → series alice follows it// 7002 Gate Late Show … Talk (a LONG name) → show from the genre, never asked; one released episode;// alice follows it// 7003 Gate Island Reality no genre, type Reality → series until TMDB's type is known (the daily sync: alice// follows it), then show// 7004 Gate Nature Docs type Documentary → series// 7005 Gate Evening News type News → show (the kind backfill)// 7006 Gate Mini type Miniseries → series// 7007 Gate Lost Kind TMDB answers 404 → series, `kindCheck`// 7008 Gate Clip Video type Video → show (the kind backfill)// — Gate No Id no tmdbId, no genre → series without a request, `kindCheck`// Self-assigned ids, one put() each (never update(), see seed-show.hl). TRACKER_SEED_USER = alice's users row (seed-show.hl's).import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'import { now } from 'hl:time'storageDir = env('TRACKER_STORAGE')if (storageDir == null || !storageDir.startsWith('/')) { hlError('set TRACKER_STORAGE, absolute') }genresTable = new MPackDB(file = storageDir + '/genres.db', primaryKey = '@id', indexes = ['!oldId'])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'])followsTable = new MPackDB(file = storageDir + '/follows.db', primaryKey = '@id', indexes = ['!oldId'])talkId = 'gk00000000000gt1'realityId = 'gk00000000000gr1'newsId = 'gk00000000000gn1'genresTable.put({ id = talkId name = 'Talk' urlSegment = 'Talk' tmdbId = 10767 oldId = 'gk-talk' })genresTable.put({ id = realityId name = 'Reality' urlSegment = 'Reality' tmdbId = 10764 oldId = 'gk-reality' })genresTable.put({ id = newsId name = 'News' urlSegment = 'News' tmdbId = 10763 oldId = 'gk-news' })// seed-show.hl's DramadramaId = 'g0000000000000g1'tv = (id, tmdbId, title, release, slug, genres, seasons) => {showsTable.put({adult = false id = id title = title summary = 'a #21 fixture' tmdbSummary = null tmdbId = tmdbIdlanguage = 'en' type = 'series' release = release year = toNumber(release.slice(0, 4)) image = null urlSegment = slugepisodesCount = 0 homepage = null imdbId = null seasonsCount = 0 status = 'Returning Series' tagline = nulltvdbId = null tvmzId = null genres = genres cast = [] seasons = seasons oldId = 'gk-' + slug})return true}tv('gk0000000000k001', 7001, 'Gate Reacher', '2022-02-04', 'gate-reacher', [dramaId], [])// the show's one season + episode (released): it is in the homepage's Shows rowlateSeason = 'gk00000000000s02'lateEpisode = 'gk00000000000e02'seasonsTable.put({ id = lateSeason seasonNumber = 1 title = null release = null summary = null show = 'gk0000000000k002' episodes = [lateEpisode] oldId = 'gk-s02' })episodesTable.put({ id = lateEpisode episodeNumber = 1 seasonNumber = 1 title = 'First Night' summary = null release = '2024-05-05' show = 'gk0000000000k002' season = lateSeason oldId = 'gk-e02' })tv('gk0000000000k002', 7002, 'Gate Late Show With A Very Long Name That Has To Wrap On A Phone', '2015-09-08', 'gate-late-show', [talkId], [lateSeason])tv('gk0000000000k003', 7003, 'Gate Island Reality', '2010-01-01', 'gate-island-reality', [], [])tv('gk0000000000k004', 7004, 'Gate Nature Docs', '2016-11-06', 'gate-nature-docs', [], [])tv('gk0000000000k005', 7005, 'Gate Evening News', '1990-01-01', 'gate-evening-news', [], [])tv('gk0000000000k006', 7006, 'Gate Mini', '2019-05-06', 'gate-mini', [], [])tv('gk0000000000k007', 7007, 'Gate Lost Kind', '2001-01-01', 'gate-lost-kind', [], [])tv('gk0000000000k008', 7008, 'Gate Clip Video', '2020-03-03', 'gate-clip-video', [], [])tv('gk0000000000k009', null, 'Gate No Id', '2003-03-03', 'gate-no-id', [], [])user = env('TRACKER_SEED_USER')if (user != null && user != '') {followsTable.put({ id = 'gkf00000000000f1' show = 'gk0000000000k001' user = user at = now() - 3000 oldId = 'gk-follow-1' })followsTable.put({ id = 'gkf00000000000f2' show = 'gk0000000000k002' user = user at = now() - 2000 oldId = 'gk-follow-2' })followsTable.put({ id = 'gkf00000000000f3' show = 'gk0000000000k003' user = user at = now() - 1000 oldId = 'gk-follow-3' })}genresTable.persist()showsTable.persist()seasonsTable.persist()episodesTable.persist()followsTable.persist()console.log('seed-kinds: 9 TV titles, 3 genres' + (user != null && user != '' ? ', 3 follows for ' + user : ''))
Branches
Latest commits
- 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
- be4890a0reports: H2 hydration audit (no test change needed)mre
- 1f9c8bf4re-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
- c1df88eddocker-compose: HL_GC_TABLE_LOAD=62 (tracker mission 048, T16 real-data numbers)mre
- d0a82867mission 048: report, LOG (HL_GC_TABLE_LOAD=62 measured)mre
- 2d4be66fre-vendor Hybriel 5df4eb7e (GC: HL_GC_TABLE_LOAD knob, mission 406)mre
- 99e7c8b9tests: realdata-m035-radii, repro-t38, realdata-060-backfill ports from env (REAL_PORT, REAL_CHROME, REPRO_CHROME), defaults unchangedmre
- 4625aa22re-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
- a6dfd6ecdeploy: person-lookup gate (tracker#46)mre
- 33ad4bd5Merge commit 'f57f64f'mre