gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitd25bd14ad25bd14amission 044: sliced merge prepare + sliced collections prepare; jobs-dump old/new check + bulk fixturemred25bd14a/tests/seed-kinds.hl

5.2 KB

  1. // tests/seed-kinds.hl — GATE FIXTURE for tracker.worldapi.org#20/#21 (mission 068, tests/kinds.mjs): TV titles of both kinds,
  2. // written into the gate's storage AFTER tests/seed-show.hl, before the server starts. The genres Talk / Reality / News (a title
  3. // 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):
  4. // 7001 Gate Reacher Drama, type Scripted → series alice follows it
  5. // 7002 Gate Late Show … Talk (a LONG name) → show from the genre, never asked; one released episode;
  6. // alice follows it
  7. // 7003 Gate Island Reality no genre, type Reality → series until TMDB's type is known (the daily sync: alice
  8. // follows it), then show
  9. // 7004 Gate Nature Docs type Documentary → series
  10. // 7005 Gate Evening News type News → show (the kind backfill)
  11. // 7006 Gate Mini type Miniseries → series
  12. // 7007 Gate Lost Kind TMDB answers 404 → series, `kindCheck`
  13. // 7008 Gate Clip Video type Video → show (the kind backfill)
  14. // — Gate No Id no tmdbId, no genre → series without a request, `kindCheck`
  15. // Self-assigned ids, one put() each (never update(), see seed-show.hl). TRACKER_SEED_USER = alice's users row (seed-show.hl's).
  16. import { MPackDB } from 'hl:mpackdb'
  17. import { env } from 'hl:proc'
  18. import { now } from 'hl:time'
  19. storageDir = env('TRACKER_STORAGE')
  20. if (storageDir == null || !storageDir.startsWith('/')) { hlError('set TRACKER_STORAGE, absolute') }
  21. genresTable = new MPackDB(file = storageDir + '/genres.db', primaryKey = '@id', indexes = ['!oldId'])
  22. showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])
  23. seasonsTable = new MPackDB(file = storageDir + '/seasons.db', primaryKey = '@id', indexes = ['!oldId'])
  24. episodesTable = new MPackDB(file = storageDir + '/episodes.db', primaryKey = '@id', indexes = ['!oldId'])
  25. followsTable = new MPackDB(file = storageDir + '/follows.db', primaryKey = '@id', indexes = ['!oldId'])
  26. talkId = 'gk00000000000gt1'
  27. realityId = 'gk00000000000gr1'
  28. newsId = 'gk00000000000gn1'
  29. genresTable.put({ id = talkId name = 'Talk' urlSegment = 'Talk' tmdbId = 10767 oldId = 'gk-talk' })
  30. genresTable.put({ id = realityId name = 'Reality' urlSegment = 'Reality' tmdbId = 10764 oldId = 'gk-reality' })
  31. genresTable.put({ id = newsId name = 'News' urlSegment = 'News' tmdbId = 10763 oldId = 'gk-news' })
  32. // seed-show.hl's Drama
  33. dramaId = 'g0000000000000g1'
  34. tv = (id, tmdbId, title, release, slug, genres, seasons) => {
  35. showsTable.put({
  36. adult = false id = id title = title summary = 'a #21 fixture' tmdbSummary = null tmdbId = tmdbId
  37. language = 'en' type = 'series' release = release year = toNumber(release.slice(0, 4)) image = null urlSegment = slug
  38. episodesCount = 0 homepage = null imdbId = null seasonsCount = 0 status = 'Returning Series' tagline = null
  39. tvdbId = null tvmzId = null genres = genres cast = [] seasons = seasons oldId = 'gk-' + slug
  40. })
  41. return true
  42. }
  43. tv('gk0000000000k001', 7001, 'Gate Reacher', '2022-02-04', 'gate-reacher', [dramaId], [])
  44. // the show's one season + episode (released): it is in the homepage's Shows row
  45. lateSeason = 'gk00000000000s02'
  46. lateEpisode = 'gk00000000000e02'
  47. seasonsTable.put({ id = lateSeason seasonNumber = 1 title = null release = null summary = null show = 'gk0000000000k002' episodes = [lateEpisode] oldId = 'gk-s02' })
  48. episodesTable.put({ id = lateEpisode episodeNumber = 1 seasonNumber = 1 title = 'First Night' summary = null release = '2024-05-05' show = 'gk0000000000k002' season = lateSeason oldId = 'gk-e02' })
  49. 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])
  50. tv('gk0000000000k003', 7003, 'Gate Island Reality', '2010-01-01', 'gate-island-reality', [], [])
  51. tv('gk0000000000k004', 7004, 'Gate Nature Docs', '2016-11-06', 'gate-nature-docs', [], [])
  52. tv('gk0000000000k005', 7005, 'Gate Evening News', '1990-01-01', 'gate-evening-news', [], [])
  53. tv('gk0000000000k006', 7006, 'Gate Mini', '2019-05-06', 'gate-mini', [], [])
  54. tv('gk0000000000k007', 7007, 'Gate Lost Kind', '2001-01-01', 'gate-lost-kind', [], [])
  55. tv('gk0000000000k008', 7008, 'Gate Clip Video', '2020-03-03', 'gate-clip-video', [], [])
  56. tv('gk0000000000k009', null, 'Gate No Id', '2003-03-03', 'gate-no-id', [], [])
  57. user = env('TRACKER_SEED_USER')
  58. if (user != null && user != '') {
  59. followsTable.put({ id = 'gkf00000000000f1' show = 'gk0000000000k001' user = user at = now() - 3000 oldId = 'gk-follow-1' })
  60. followsTable.put({ id = 'gkf00000000000f2' show = 'gk0000000000k002' user = user at = now() - 2000 oldId = 'gk-follow-2' })
  61. followsTable.put({ id = 'gkf00000000000f3' show = 'gk0000000000k003' user = user at = now() - 1000 oldId = 'gk-follow-3' })
  62. }
  63. genresTable.persist()
  64. showsTable.persist()
  65. seasonsTable.persist()
  66. episodesTable.persist()
  67. followsTable.persist()
  68. console.log('seed-kinds: 9 TV titles, 3 genres' + (user != null && user != '' ? ', 3 follows for ' + user : ''))

Branches

Latest commits

  • d25bd14amission 044: sliced merge prepare + sliced collections prepare; jobs-dump old/new check + bulk fixturemre
  • 633ee210mission 044: sliced table scans (slices.hl, pk-range slices) for the adult/kind/status/art/credits/details-repair queuesmre
  • 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