tracker
All repositories: gitoria
3.5 KB
// tests/seed-mobile.hl — GATE FIXTURE for the mobile audit (mission MK, tests/mobile.mjs): written into the gate's storage AFTER// tests/seed-show.hl (it uses its 'Pager Movie NN' titles), before the server starts.// franchise 'Mobile Franchise' with one timeline 'Mobile Timeline Alpha' (Pager Movie 01, 02, 03) → a movie page's widget with the franchise link// series 'Mobile Soap' with ONE season of 160 episodes (the real data has one of 1,175) → its page starts with that season CLOSED// 100 timelines WITHOUT a franchise 'Mobile Collection 001' … '100' (one Pager Movie each) → /franchises: 40 per page = 3 pages// Self-assigned ids, one put() each (never update(), see seed-show.hl).import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'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'])franchisesTable = new MPackDB(file = storageDir + '/franchises.db', primaryKey = '@id', indexes = ['!slug'])timelinesTable = new MPackDB(file = storageDir + '/timelines.db', primaryKey = '@id', indexes = ['!slug'])franchisesTable.put({ id = 'mb0000000000fr01' name = 'Mobile Franchise' slug = 'mobile-franchise' shortId = null summary = 'A franchise for the phone gate.' created = 1 })timelinesTable.put({ id = 'mb0000000000tl00' name = 'Mobile Timeline Alpha' slug = 'mobile-timeline-alpha' franchise = 'mb0000000000fr01'order = ['mv00000000000m01', 'mv00000000000m02', 'mv00000000000m03'] source = 'editor' tmdbCollection = null orderKind = 'in-universe' supersededBy = null created = 2 })let i = 1while (i <= 100) {let nn = i < 10 ? '00' + i : (i < 100 ? '0' + i : '' + i)let mv = 10 + (i % 20)timelinesTable.put({ id = 'mb0000000000t' + nn name = 'Mobile Collection ' + nn slug = 'mobile-collection-' + nn franchise = nullorder = ['mv00000000000m' + mv] source = 'tmdb' tmdbCollection = 7000 + i orderKind = null supersededBy = null created = 10 + i })i = i + 1}let eps = []let e = 1while (e <= 160) {let en = e < 10 ? '00' + e : (e < 100 ? '0' + e : '' + e)eps.push('mb000000000ep' + en)episodesTable.put({ id = 'mb000000000ep' + en episodeNumber = e seasonNumber = 1 title = 'Soap Day ' + e summary = null release = '2020-01-01' show = 'mb0000000000soap' season = 'mb0000000000ssn1' oldId = 'mb-ep' + en })e = e + 1}seasonsTable.put({ id = 'mb0000000000ssn1' seasonNumber = 1 title = null release = null summary = null show = 'mb0000000000soap' episodes = eps oldId = 'mb-s1' })showsTable.put({adult = false id = 'mb0000000000soap' title = 'Mobile Soap' summary = 'A soap with one very long season.' tmdbSummary = null tmdbId = nulllanguage = 'en' type = 'series' release = '2020-01-01' year = 2020 image = null urlSegment = 'mobile-soap'episodesCount = 160 homepage = null imdbId = null seasonsCount = 1 status = 'Returning Series' tagline = nulltvdbId = null tvmzId = null genres = [] cast = [] seasons = ['mb0000000000ssn1'] oldId = 'mb-soap'})showsTable.persist()seasonsTable.persist()episodesTable.persist()franchisesTable.persist()timelinesTable.persist()console.log('seed-mobile: 1 franchise + 1 timeline + 100 loose timelines + a soap of 160 episodes')
Branches
Latest commits
- 8e6aa91dlog: GC1 deploy retrymre
- 87ad2dc1log: GC1 deployingmre
- 53f10fb8Merge branch 'gc1-deploy'mre
- 7fcbf1d2log: GC1 deploy GOmre
- 1fb6664bcompose: TRACKER_QSTATS=1 (GC1 measurement)mre
- 6576c1cdgc1: release the people-view scan lists once the view is builtmre
- 94f8a373gc1: back out the kept episode-id set (no measurable gain on /my/unwatched: 4.69 -> 4.61 GB per 150 loads)mre
- a1a88bd4gc1: search skips the stale-key string while no entry is stale; /my/unwatched asks a kept id set instead of building a key string per episode rowmre
- cd830744gc1: dbSearch: no split / map / list copy per candidate (scores from the stored text, top list touched only when the hit can enter)mre
- 451db7cdgc1: show page and check clicks read the kept watched set instead of building one from a by-value copy of every watchmre
- ddb4127egc1: TRACKER_QSTATS=1 logs queue and cache sizes every 10 s (measurement only)mre
- da60547fstatus: GC1 done, backup bugmre
- e4171021log: GC1 result, backup hard-link bugmre
- f1597214deploy.sh backup: tar --hard-dereference (hot tar stored mpackdb sidecars as hard links to .sessions files)mre
- 6b58571elog: GC windowmre
- 5c8baa1fdeploy lock: hold only around deploy.shmre
- b8dac822log: hybriel#309mre
- bf676d9elog: GC1 startedmre
- c7828541mission GC1mre
- ef949994conductor: neutral ticket rulemre