tracker
All repositories: gitoria
2.8 KB
// tests/seed-pager.hl — GATE FIXTURE for tracker.worldapi.org#38 (mission 033, tests/pager.mjs): every paginated list with 11// pages of 24, so the pagination shows "…" and its list changes length from click to click (what tracker#38 needed to show):// 250 movies 'Pg Movie 001'…'250' (released 1801…2050, genre Pagerg) → /movies, /genres/Pagerg (newest first: 250 … 001)// 250 series 'Pg Series 001'…'250' (kind series, released 1801…2050) → /series (newest first)// 250 shows 'Pg Show 001'…'250' (kind show, genre Talk, 1801…2050) → /shows (newest first)// 250 people 'Pgperson 001'…'250' (updatedAt 1001…1250) → /people (last updated first: 250 … 001)// Written into the gate's own empty storage before the server starts; self-assigned ids, one put() each.import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'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'])personsTable = new MPackDB(file = storageDir + '/persons.db', primaryKey = '@id', indexes = ['!oldId'])showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])genreId = 'pg00000000000gp1'talkId = 'pg00000000000gt1'genresTable.put({ id = genreId name = 'Pagerg' urlSegment = 'Pagerg' tmdbId = 99001 oldId = 'pg-pagerg' })genresTable.put({ id = talkId name = 'Talk' urlSegment = 'Talk' tmdbId = 10767 oldId = 'pg-talk' })title = (id, name, type, kind, year, slug, genres) => {showsTable.put({adult = false id = id title = name summary = null tmdbSummary = null tmdbId = null kind = kindlanguage = 'en' type = type release = year + '-01-01' year = year image = null urlSegment = slugepisodesCount = null homepage = null imdbId = null seasonsCount = null status = null tagline = nulltvdbId = null tvmzId = null genres = genres cast = [] seasons = [] oldId = id})return true}let i = 1while (i <= 250) {let nnn = i < 10 ? '00' + i : (i < 100 ? '0' + i : '' + i)let y = 1800 + ititle('pgm00000000' + nnn, 'Pg Movie ' + nnn, 'movie', null, y, 'pg-movie-' + nnn, [genreId])title('pgs00000000' + nnn, 'Pg Series ' + nnn, 'series', 'series', y, 'pg-series-' + nnn, [])title('pgt00000000' + nnn, 'Pg Show ' + nnn, 'series', 'show', y, 'pg-show-' + nnn, [talkId])personsTable.put({ id = 'pgp00000000' + nnn name = 'Pgperson ' + nnn urlSegment = 'Pgperson-' + nnn updatedAt = 1000 + i tmdbId = null shows = [] oldId = 'pgp' + nnn })i = i + 1}genresTable.persist()showsTable.persist()personsTable.persist()console.log('seed-pager: 250 movies, 250 series, 250 shows, 250 people')
Branches
Latest commits
- f57f64f0mission 046: report, LOGmre
- efe1b485mission 046: re-vendor Hybriel master 60b2817b (integration 8, #203): plugins mpackdb + web (bin/ git-ignored: hybriel, libhlrt.a, hlc.o, hlrt/ from native/zig-out)mre
- 53099ffbmission 046: person page reads a slim per-title credit row cache (no whole-record fetch per credit); gate tests/person-lookup.mjsmre
- 9b3828aemission 046a: report, LOGmre
- 4b37356emission 046: franchise seed supersedeCollections reads the curated timelines once (10 s one-tick block at the end of boot)mre
- ac6268e3mission 046a: re-vendor Hybriel 528bc89f (integration 6): plugins mpackdb/time/web (bin/ git-ignored)mre
- 322b3293mission 046: photoQueue guard for non-row fetch results (damaged persons index)mre
- e5b99aecmission 046: photoQueue in slices (people.hl photoQueueStart/Step, jobs.hl photoTick), tests/photoqueue.hlmre
- 31dcf2admission 045: report, LOGmre
- 9c3971d0tests/persons-skip-count.hlmre
- 4d72e365mission 045mre
- b9cae4c9slices: skip and count non-row values from range(); merge persons pass falls back to iterate; guard testmre
- 3db7dc31merge w44-jobs-slices into w43-trkmemmre
- 593dab6fmission 043: report, LOGmre
- 1a5a4818boot scans back to iterate (slices measured slower: titles 114 s, episodes 141 s, persons failed); lambda per rowmre
- 03d29893boot scans read primary-key slices (lib/slices.hl from mission 044): iterate is eager too; people view log line back; allShows/allEpisodes stay for toolsmre
- 23375c58mission 044: report, LOG, STATUSmre
- c6fd928emission 044: 4096 slices for tables over 200 K rows, 15 ms budget, TRACKER_SLICE_DEPTH for testsmre
- fb057680mission 044: jobs.hl imports mergeLeft (gate found it), mission file, slices benchmre
- 0d6293ebmission 043: mission filemre