gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6648ba446648ba44mission 042: real-browser E2E on ce6f2e0a re-vendor 69/0 at 390 + 1280mre6648ba44/tests/seed-dupes.hl

10.8 KB

  1. // tests/seed-dupes.hl — GATE FIXTURE for mission 026 (tracker#31, duplicate titles): written by tests/browser.mjs into the gate's
  2. // storage while the app is STOPPED (one process per storage, hybriel#21), late in the gate. Self-assigned ids, one put() each.
  3. // Shaped like the live data's migrated duplicates (Mongo-like oldIds in creation order, shared slugs):
  4. // Dupe Gate Series (tv 1301) ×3:
  5. // A oldest, slug Dupe-Gate-Series, short id dupa1: S1 (E1, E2) + S3 (E1 — B has no S3 → moved), cast Dupe Cast A
  6. // B slug Dupe-Gate-Series-2, short id dupb1: alice FOLLOWS it, watched S1E1 → the keeper; S1 (E1, E2) + S2 (E1), cast Dupe Cast B
  7. // C slug Dupe-Gate-Series-2 (shared, like Archive 81), short id dupc1: S1 (E1, E2, E3 — B has no E3 → moved), alice watched
  8. // S1E2 there (→ B's E2); a person's credit (Dupe Credit Person) and a timeline (Dupe Gate Line) name C
  9. // Dupe Gate Movie (movie 1303) ×2: M1 older (slug Dupe-Gate-Movie, dupm1), M2 (slug Dupe-Gate-Movie-2, dupm2) alice watched → keeper
  10. // Stray Gate Series (tv 1302), one record: listed S1 (E1, E2, the sync's kind: tmdb-season oldId); stray seasons naming it but
  11. // not listed — S1' (E1, E2: alice watched both + checked the season) → merged into S1; S2' (E1: alice watched) → linked;
  12. // S3' (E1, nobody watched) → stays as it is
  13. // Double Episode Series (tv 1305, tracker#39), one record, alice follows it: listed S1 holds DOUBLE EPISODES like the live data —
  14. // migrated E1 (TMDB id 9001, TMDB has replaced it; alice watched it) + E2 (9002), and the sync's E1 (tmdb-episode:9101) + E2
  15. // (9102); listed S2 a migrated E1 with a stale TMDB id (9201; the fake TMDB lists 9301) for the sync's number match
  16. // (tests/paths-m039.hl)
  17. import { MPackDB } from 'hl:mpackdb'
  18. import { env } from 'hl:proc'
  19. import { now } from 'hl:time'
  20. storageDir = env('TRACKER_STORAGE')
  21. if (storageDir == null || !storageDir.startsWith('/')) { hlError('set TRACKER_STORAGE, absolute') }
  22. userId = env('TRACKER_SEED_USER')
  23. if (userId == null || userId == '') { hlError('set TRACKER_SEED_USER') }
  24. showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])
  25. seasonsTable = new MPackDB(file = storageDir + '/seasons.db', primaryKey = '@id', indexes = ['!oldId'])
  26. episodesTable = new MPackDB(file = storageDir + '/episodes.db', primaryKey = '@id', indexes = ['!oldId'])
  27. followsTable = new MPackDB(file = storageDir + '/follows.db', primaryKey = '@id', indexes = ['!oldId'])
  28. watchesTable = new MPackDB(file = storageDir + '/watches.db', primaryKey = '@id', indexes = ['!oldId'])
  29. personsTable = new MPackDB(file = storageDir + '/persons.db', primaryKey = '@id', indexes = ['!oldId'])
  30. timelinesTable = new MPackDB(file = storageDir + '/timelines.db', primaryKey = '@id', indexes = ['!slug'])
  31. title = (id, tmdbId, type, name, slug, sid, oldId, seasons, cast) => {
  32. showsTable.put({ adult = false id = id title = name summary = null tmdbSummary = 'a duplicate' tmdbId = tmdbId
  33. language = 'en' type = type release = '2019-04-04' year = 2019 image = null urlSegment = slug
  34. episodesCount = null homepage = null imdbId = null seasonsCount = null status = 'Ended' tagline = null
  35. tvdbId = null tvmzId = null genres = [] cast = cast seasons = seasons oldId = oldId shortId = sid kind = type == 'series' ? 'series' : null
  36. creditsAt = 1 detailsAt = 1 })
  37. return true
  38. }
  39. season = (id, show, n, eps, oldId) => {
  40. seasonsTable.put({ id = id seasonNumber = n title = 'Season ' + n release = '2019-04-04' summary = '' show = show episodes = eps oldId = oldId })
  41. return true
  42. }
  43. episode = (id, show, seasonId, n, e, name) => {
  44. episodesTable.put({ id = id episodeNumber = e seasonNumber = n title = name summary = '' release = '2019-04-0' + e show = show season = seasonId oldId = 'o' + id })
  45. return true
  46. }
  47. watch = (id, type, target) => {
  48. watchesTable.put({ id = id targetType = type target = target user = userId at = now() oldId = 'gw-' + id })
  49. return true
  50. }
  51. // Dupe Gate Series
  52. episode('dpae000000000a11', 'dpa000000000000a', 'dpas00000000000a', 1, 1, 'Pilot A')
  53. episode('dpae000000000a12', 'dpa000000000000a', 'dpas00000000000a', 1, 2, 'Second A')
  54. season('dpas00000000000a', 'dpa000000000000a', 1, ['dpae000000000a11', 'dpae000000000a12'], '5f00000000000000000000a1')
  55. episode('dpae000000000a31', 'dpa000000000000a', 'dpas0000000000a3', 3, 1, 'Third Season Start')
  56. season('dpas0000000000a3', 'dpa000000000000a', 3, ['dpae000000000a31'], '5f00000000000000000000a3')
  57. title('dpa000000000000a', 1301, 'series', 'Dupe Gate Series', 'Dupe-Gate-Series', 'dupa1', '5f0000000000000000000001', ['dpas00000000000a', 'dpas0000000000a3'],
  58. [{ person = 'dpp000000000000a' character = 'Role A' actor = 'Dupe Cast A' }])
  59. episode('dpbe000000000b11', 'dpb000000000000b', 'dpbs00000000000b', 1, 1, 'Pilot')
  60. episode('dpbe000000000b12', 'dpb000000000000b', 'dpbs00000000000b', 1, 2, 'Second')
  61. season('dpbs00000000000b', 'dpb000000000000b', 1, ['dpbe000000000b11', 'dpbe000000000b12'], '5f00000000000000000000b1')
  62. episode('dpbe000000000b21', 'dpb000000000000b', 'dpbs0000000000b2', 2, 1, 'Second Season Start')
  63. season('dpbs0000000000b2', 'dpb000000000000b', 2, ['dpbe000000000b21'], '5f00000000000000000000b2')
  64. title('dpb000000000000b', 1301, 'series', 'Dupe Gate Series', 'Dupe-Gate-Series-2', 'dupb1', '5f0000000000000000000002', ['dpbs00000000000b', 'dpbs0000000000b2'],
  65. [{ person = 'dpp000000000000b' character = 'Role B' actor = 'Dupe Cast B' }])
  66. episode('dpce000000000c11', 'dpc000000000000c', 'dpcs00000000000c', 1, 1, 'Pilot C')
  67. episode('dpce000000000c12', 'dpc000000000000c', 'dpcs00000000000c', 1, 2, 'Second C')
  68. episode('dpce000000000c13', 'dpc000000000000c', 'dpcs00000000000c', 1, 3, 'Only In C')
  69. season('dpcs00000000000c', 'dpc000000000000c', 1, ['dpce000000000c11', 'dpce000000000c12', 'dpce000000000c13'], '5f00000000000000000000c1')
  70. title('dpc000000000000c', 1301, 'series', 'Dupe Gate Series', 'Dupe-Gate-Series-2', 'dupc1', '5f0000000000000000000003', ['dpcs00000000000c'], [])
  71. personsTable.put({ id = 'dpp000000000000a' name = 'Dupe Cast A' urlSegment = 'Dupe-Cast-A' tmdbId = null oldId = 'dpp-a' shortId = 'dupp1' filmographyAt = 1
  72. shows = [{ show = 'dpa000000000000a' character = 'Role A' }] })
  73. personsTable.put({ id = 'dpp000000000000b' name = 'Dupe Cast B' urlSegment = 'Dupe-Cast-B' tmdbId = null oldId = 'dpp-b' shortId = 'dupp2' filmographyAt = 1
  74. shows = [{ show = 'dpb000000000000b' character = 'Role B' }] })
  75. personsTable.put({ id = 'dpp000000000000c' name = 'Dupe Credit Person' urlSegment = 'Dupe-Credit-Person' tmdbId = null oldId = 'dpp-c' shortId = 'dupp3' filmographyAt = 1
  76. shows = [{ show = 'dpc000000000000c' character = 'Guest In C' }] })
  77. // tests/paths-m026.hl: a person whose filmography is not fetched yet (fake TMDB person 3301: tv 1301, movie 1303, NEW movie 1304)
  78. personsTable.put({ id = 'dpp000000000000d' name = 'Dupe Fill Person' urlSegment = 'Dupe-Fill-Person' tmdbId = 3301 oldId = 'dpp-d' shortId = 'dupp4' })
  79. followsTable.put({ id = 'dpf00000000000f1' show = 'dpb000000000000b' user = userId at = now() oldId = 'gate-follow-dupe' })
  80. watch('dpw00000000000w1', 'episode', 'dpbe000000000b11')
  81. watch('dpw00000000000w2', 'episode', 'dpce000000000c12')
  82. timelinesTable.put({ id = 'dpt00000000000t1' name = 'Dupe Gate Line' slug = 'dupe-gate-line' franchise = null order = ['dpc000000000000c', 'dpm00000000000m2'] source = 'editor'
  83. tmdbCollection = null created = now() })
  84. // Dupe Gate Movie
  85. title('dpm00000000000m1', 1303, 'movie', 'Dupe Gate Movie', 'Dupe-Gate-Movie', 'dupm1', '5f0000000000000000000011', [], [])
  86. title('dpm00000000000m2', 1303, 'movie', 'Dupe Gate Movie', 'Dupe-Gate-Movie-2', 'dupm2', '5f0000000000000000000012', [], [])
  87. watch('dpw00000000000w3', 'movie', 'dpm00000000000m2')
  88. // Stray Gate Series
  89. episode('dpse000000000s11', 'dps000000000000s', 'dpss00000000000s', 1, 1, 'Stray Pilot')
  90. episode('dpse000000000s12', 'dps000000000000s', 'dpss00000000000s', 1, 2, 'Stray Second')
  91. season('dpss00000000000s', 'dps000000000000s', 1, ['dpse000000000s11', 'dpse000000000s12'], 'tmdb-season:1302:1')
  92. episode('dpse00000000x111', 'dps000000000000s', 'dpss0000000000x1', 1, 1, 'Old Stray Pilot')
  93. episode('dpse00000000x112', 'dps000000000000s', 'dpss0000000000x1', 1, 2, 'Old Stray Second')
  94. season('dpss0000000000x1', 'dps000000000000s', 1, ['dpse00000000x111', 'dpse00000000x112'], '5f00000000000000000000x1')
  95. episode('dpse00000000x211', 'dps000000000000s', 'dpss0000000000x2', 2, 1, 'Watched Special')
  96. season('dpss0000000000x2', 'dps000000000000s', 2, ['dpse00000000x211'], '5f00000000000000000000x2')
  97. episode('dpse00000000x311', 'dps000000000000s', 'dpss0000000000x3', 3, 1, 'Nobody Watched')
  98. season('dpss0000000000x3', 'dps000000000000s', 3, ['dpse00000000x311'], '5f00000000000000000000x3')
  99. title('dps000000000000s', 1302, 'series', 'Stray Gate Series', 'Stray-Gate-Series', 'dups1', '5f0000000000000000000021', ['dpss00000000000s'], [])
  100. followsTable.put({ id = 'dpf00000000000f2' show = 'dps000000000000s' user = userId at = now() - 1000 oldId = 'gate-follow-stray' })
  101. watch('dpw00000000000w4', 'episode', 'dpse00000000x111')
  102. watch('dpw00000000000w5', 'episode', 'dpse00000000x112')
  103. watch('dpw00000000000w6', 'season', 'dpss0000000000x1')
  104. watch('dpw00000000000w7', 'episode', 'dpse00000000x211')
  105. // Double Episode Series (tracker#39)
  106. ep39 = (id, n, e, tmdbId, oldId, name) => {
  107. episodesTable.put({ id = id episodeNumber = e seasonNumber = n title = name summary = '' release = '2018-0' + n + '-0' + e show = 'dde000000000000d'
  108. season = n == 1 ? 'dds00000000000s1' : 'dds00000000000s2' tmdbId = tmdbId oldId = oldId })
  109. return true
  110. }
  111. ep39('dde0000000000e11', 1, 1, 9001, '5f00000000000000000000e1', 'Old Pilot')
  112. ep39('dde0000000000e12', 1, 2, 9002, '5f00000000000000000000e2', 'Old Second')
  113. ep39('dde0000000000t11', 1, 1, 9101, 'tmdb-episode:9101', 'Pilot')
  114. ep39('dde0000000000t12', 1, 2, 9102, 'tmdb-episode:9102', 'Second')
  115. ep39('dde0000000000e21', 2, 1, 9201, '5f00000000000000000000e3', 'Old Two One')
  116. season('dds00000000000s1', 'dde000000000000d', 1, ['dde0000000000e11', 'dde0000000000e12', 'dde0000000000t11', 'dde0000000000t12'], '5f00000000000000000000d1')
  117. season('dds00000000000s2', 'dde000000000000d', 2, ['dde0000000000e21'], '5f00000000000000000000d2')
  118. title('dde000000000000d', 1305, 'series', 'Double Episode Series', 'Double-Episode-Series', 'dupd1', '5f0000000000000000000031', ['dds00000000000s1', 'dds00000000000s2'], [])
  119. followsTable.put({ id = 'dpf00000000000f3' show = 'dde000000000000d' user = userId at = now() - 2000 oldId = 'gate-follow-double' })
  120. watch('dpw00000000000w8', 'episode', 'dde0000000000e11')
  121. showsTable.persist()
  122. seasonsTable.persist()
  123. episodesTable.persist()
  124. followsTable.persist()
  125. watchesTable.persist()
  126. personsTable.persist()
  127. timelinesTable.persist()
  128. console.log('seed-dupes: Dupe Gate Series ×3, Dupe Gate Movie ×2, Stray Gate Series with 3 stray seasons, Double Episode Series; ' + userId + ' follows 3, 8 watches')

Branches

Latest commits

  • 6648ba44mission 042: real-browser E2E on ce6f2e0a re-vendor 69/0 at 390 + 1280mre
  • 3ed3a0efmission 042: gates old/new equal (browser #41 route-table regex accepts unescaped hl:web output), real-data TTFB, E2E blocked by lisbeth lockmre
  • d5b61e90LOG 042mre
  • 4acdbaccmission 042: memory comparison old vs ce6f2e0a (stopped: warm VmHWM higher), reportmre
  • d0f620d6mission 042: re-vendor Hybriel ce6f2e0a (plugins incl. mpackdb; bin runtime built from the same archive, git-ignored), compact=false keptmre
  • 5bd14e12mission 040: theme 76f99f6 gates + E2E green; 44 px fixes (skeleton row, type-word, genre-link/pill); README, reportmre
  • 77cfa45cmission 040: partial report (theme/modal/pagination re-copied, tilelist onPage, 44 px taps; gates new + E2E pending)mre
  • 4b14822fe2e-theme: menu marker by colourmre
  • 09780f4emission 040 WIP: theme, modal, pagination, tokens re-copied from layouts 76f99f6; tilelist uses onPage; tap sizes 44 px for tracker's own small buttons; tests/e2e-theme.mjsmre
  • fb80bb8chotfix: open the 5 show stores without compaction (compact = false) — compact-on-open left another handle on stale offsets, every read gave a bare Number (hybriel mpackdb refresh after a shrink); live down 2026-10-20 05:11mre
  • e00d3bf7paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • a8c7f234tracker#36 (mission 039): tools/tmdb-check.hl survives a dropped connection (on Error, asked again, failed lines) and resumes with --from N; tests/tmdbcheck.mjs 6/6 against a fake TMDBmre
  • 9c230516mission brief w39mre
  • 3609121dmission 038 docs + report (quota stop): README/kinds.md for #43 #42 #36, STATUS, LOG; HEAD browser gate 374/8 in the in-app daily run block (hour-boundary suspected, rerun pending), other gates green; #36 real run needs TMDB_READ_TOKENmre
  • a5d06e79tracker#36 (mission 038): tools/tmdb-check.hl + lib/tmdbcheck.hl — every live migrated title's migrated title + year against its TMDB entry (one GET /movie|tv/<id>?append_to_response=alternative_titles, 260 ms apart, passing failures asked once more): ok / ambiguous (one of title, year disagrees) / clear (both, or 404); read-only; token only from TMDB_READ_TOKEN; --stored = a title-only preview from the TMDB names already stored (no request). Tested against a fake TMDB (.scratch/w38/t36): 7 titles, 3 ok, 2 ambiguous, 2 clear, data unchangedmre
  • 982554f3tracker#42 (mission 038): series pages — an unknown slug no longer scans every title (lib/shows.hl showBySlug: the slug map only; new titles are noted by refreshTitleCaches, which both title puts already reach): 10.7–15.7 s → 0.013 s on the real copy (the one-request-at-a-time server was blocked meanwhile); cast/crew rows take name + slug from a person-link cache (personLinkOf) instead of whole person records (SNL: 303 cast with 4,761 credits, ~49k allocations per render) — allocations per series page −5…−40 %; HTML of 20 pages identical to beforemre
  • 4586b6e3docker-compose: init: true (hybriel#156)mre
  • 085c2e5ftracker#43 (mission 038): TVmaze's type makes Variety / Talk Show / Game Show / Reality / News / Panel Show / Award Show / Sports titles Shows (TMDB calls Saturday Night Live UK Scripted) — the #43 part of parked w37-wip a79c8c1 only (no re-vendor, no cache volume): tvmazeType stored by the sync and the TVmaze status backfill (asks every series with a TVmaze id once), kindOfTitle/kindWithTvmaze, tools/tvmaze-types.hl, gate fixture Variety Gate Series; start waits 150 smre
  • 4fa303b5mission brief w38mre
  • 975f6843tracker#41 (mission 037b): no request tap — an old /movies|/series slug renders the keeper's page (slug map) with og:url naming the keeper's address, /shows/ 301; no moved slug in any page's HTML. Real copy 168/168 old addresses, 0 moved slugs in 54 pages, 300x + 1000x stress without a crash; gates on 06617221 380/0, 32/0, 53/0, 229/0, 26/0, theme 0mre