gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commita97c0295a97c0295tracker#4: show page /shows/:slug (header, seasons, episodes, watch checks) + tools/relink-episode-seasons.hlmrea97c0295/tests/seed-show.hl

3.5 KB

  1. // tests/seed-show.hl — GATE FIXTURE for tracker.worldapi.org#4: one small show with two seasons and
  2. // three episodes, written directly into a fresh storage/mpackdb/ (given as TRACKER_STORAGE) before the
  3. // gate server starts. Not the real migrated data (tests/browser.mjs does not run the real migration —
  4. // too slow for a gate) — just enough to drive the show page's own checks.
  5. //
  6. // IDS ARE SELF-ASSIGNED (fixed literals, one put() per record — never update()), the same rule
  7. // tools/migrate.hl follows for its real two-way references (Show.seasons/Season.show, Episode.show/
  8. // season): hl:mpackdb's update() can lose rows across a reopen in a fresh process (hybriel#113) — and
  9. // the gate DOES reopen this same storage dir in a fresh process right after this script exits.
  10. import { MPackDB } from 'hl:mpackdb'
  11. import { env } from 'hl:proc'
  12. storageDir = env('TRACKER_STORAGE')
  13. if (storageDir == null || !storageDir.startsWith('/')) { hlError('set TRACKER_STORAGE, absolute') }
  14. genresTable = new MPackDB(file = storageDir + '/genres.db', primaryKey = '@id', indexes = ['!oldId'])
  15. personsTable = new MPackDB(file = storageDir + '/persons.db', primaryKey = '@id', indexes = ['!oldId'])
  16. showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])
  17. seasonsTable = new MPackDB(file = storageDir + '/seasons.db', primaryKey = '@id', indexes = ['!oldId'])
  18. episodesTable = new MPackDB(file = storageDir + '/episodes.db', primaryKey = '@id', indexes = ['!oldId'])
  19. watchesTable = new MPackDB(file = storageDir + '/watches.db', primaryKey = '@id', indexes = ['!oldId'])
  20. genreId = 'g0000000000000g1'
  21. personId = 'p0000000000000p1'
  22. showId = 'sh00000000000sh1'
  23. season1Id = 'se000000000se0s1'
  24. season2Id = 'se000000000se0s2'
  25. ep1Id = 'ep0000000000ep0e1'
  26. ep2Id = 'ep0000000000ep0e2'
  27. ep3Id = 'ep0000000000ep0e3'
  28. genresTable.put({ id = genreId name = 'Drama' urlSegment = 'Drama' oldId = 'g1' })
  29. personsTable.put({ id = personId name = 'Test Actor' urlSegment = 'Test-Actor' oldId = 'p1' })
  30. seasonsTable.put({ id = season1Id seasonNumber = 1 title = null release = null summary = null show = showId episodes = [ep1Id, ep2Id] oldId = 's1' })
  31. seasonsTable.put({ id = season2Id seasonNumber = 2 title = null release = null summary = null show = showId episodes = [ep3Id] oldId = 's2' })
  32. episodesTable.put({ id = ep1Id episodeNumber = 1 seasonNumber = 1 title = 'Pilot' summary = null release = null show = showId season = season1Id oldId = 'ep1' })
  33. episodesTable.put({ id = ep2Id episodeNumber = 2 seasonNumber = 1 title = 'Second' summary = null release = null show = showId season = season1Id oldId = 'ep2' })
  34. episodesTable.put({ id = ep3Id episodeNumber = 1 seasonNumber = 2 title = 'Season Two Opener' summary = null release = null show = showId season = season2Id oldId = 'ep3' })
  35. showsTable.put({
  36. id = showId title = 'Gate Test Show' summary = 'a fixture show for the gate' tmdbSummary = null tmdbId = null
  37. language = 'en' type = 'series' release = null year = 2024 image = 'jpg' urlSegment = 'gate-test-show'
  38. episodesCount = 3 homepage = null imdbId = null seasonsCount = 2 status = 'Ended' tagline = null
  39. tvdbId = null tvmzId = null genres = [genreId] cast = [{ person = personId character = 'Someone' actor = 'Test Actor' }]
  40. seasons = [season1Id, season2Id] oldId = 'sh1'
  41. })
  42. genresTable.persist()
  43. personsTable.persist()
  44. showsTable.persist()
  45. seasonsTable.persist()
  46. episodesTable.persist()
  47. watchesTable.persist()
  48. console.log('seed: show ' + showId + ' (gate-test-show), seasons ' + season1Id + ',' + season2Id + ', episodes ' + ep1Id + ',' + ep2Id + ',' + ep3Id)

Branches

Latest commits

  • a97c0295tracker#4: show page /shows/:slug (header, seasons, episodes, watch checks) + tools/relink-episode-seasons.hlmre
  • 05f407c5tracker: no border on any button except inverted ones (Log out, ident status and identities too); header brand weight 100mre
  • 17375427tracker#2: tools/migrate.hl + tools/verify.hl — old MongoDB data into mpackdb with new idsmre
  • 31aac936tracker#3: no border on the header and on filled buttons; inverted buttons keep theirsmre
  • 2ad9d29ctracker#1: login exactly like calendar (identity selector in the header, empty homepage)mre
  • 3691e176tracker#1: empty tracker with the ident login (state of 2026-09-27)mre