gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc21aff6bc21aff6bMerge branch 'records-hm55c' into mainTrackerc21aff6b/tools/check-public-slugs.hl

2.5 KB

  1. // tools/check-public-slugs.hl — mission 056, the REAL-DATA check (not the gate). ONLY on a COPY or a stopped app (one process
  2. // per storage, hybriel#21). Reads SLUGS (a file: the /shows/<slug> slugs that tests/realdata-056.mjs collected from the
  3. // public pages, separated by single spaces — hl strings have no newline escape) and prints how many are adult true / false
  4. // / unknown / missing; then the adult titles a user follows (USER_ID, optional) and the poster files of adult vs other titles.
  5. // TRACKER_STORAGE=$PWD/.scratch/realdata/storage/mpackdb SLUGS=/tmp/w056/real/slugs.txt USER_ID=0mujqspn0aqb ./bin/hybriel tools/check-public-slugs.hl
  6. import { MPackDB } from 'hl:mpackdb'
  7. import { env } from 'hl:proc'
  8. import { readFile, exists } from 'hl:fs'
  9. dir = env('TRACKER_STORAGE')
  10. shows = new MPackDB(file = dir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])
  11. follows = new MPackDB(file = dir + '/follows.db', primaryKey = '@id', indexes = ['!oldId'])
  12. bySlug = {}
  13. byId = {}
  14. adultPosters = 0
  15. adultNoPoster = 0
  16. otherPosters = 0
  17. for (s of shows.find(null, null)) {
  18. bySlug[s.urlSegment] = s
  19. byId[s.id] = s
  20. file = s.oldId != null && s.image != null && s.image != '' ? dir + '/posters/' + s.oldId + '.' + s.image : null
  21. has = file != null && exists(file)
  22. if (s.adult == true) { if (has) { adultPosters = adultPosters + 1 } else { adultNoPoster = adultNoPoster + 1 } } else if (has) { otherPosters = otherPosters + 1 }
  23. }
  24. slugFile = env('SLUGS')
  25. if (slugFile != null && slugFile != '') {
  26. counts = { notAdult = 0 adult = 0 unknown = 0 missing = 0 }
  27. bad = []
  28. let n = 0
  29. for (line of readFile(slugFile).split(' ')) {
  30. slug = line.trim()
  31. if (slug != '') {
  32. n = n + 1
  33. s = bySlug[slug]
  34. if (s == null) { counts.missing = counts.missing + 1 bad.push('missing ' + slug) }
  35. else if (s.adult == false) { counts.notAdult = counts.notAdult + 1 }
  36. else if (s.adult == true) { counts.adult = counts.adult + 1 bad.push('ADULT ' + slug) }
  37. else { counts.unknown = counts.unknown + 1 bad.push('unknown ' + slug) }
  38. }
  39. }
  40. print('slugs=' + n + ' notAdult=' + counts.notAdult + ' adult=' + counts.adult + ' unknown=' + counts.unknown + ' missing=' + counts.missing)
  41. for (b of bad) { print(' ' + b) }
  42. }
  43. uid = env('USER_ID')
  44. if (uid != null && uid != '') {
  45. for (f of follows.find(null, null)) {
  46. s = byId[f.show]
  47. if (f.user == uid && s != null && s.adult == true) { print('followed adult: ' + s.urlSegment + ' (' + s.title + ')') }
  48. }
  49. }
  50. print('posters: adult titles with a file=' + adultPosters + ' without=' + adultNoPoster + '; other titles with a file=' + otherPosters)

Branches

Latest commits

  • c21aff6bMerge branch 'records-hm55c' into mainTracker
  • 9ba258d3|||PR records: HM55b resultTracker
  • 64f2d300Merge branch 'records-hm55b2' into mainTracker
  • ae3b80dc|||PR records: HM55b briefTracker
  • 7ef3cb3bMerge branch 'records-st55' into mainTracker
  • fec2e080|||PR records: STATUS HM55Tracker
  • 8e174918Merge branch 'records-hm55b' into mainTracker
  • b1ecee57|||PR records: HM55 stateTracker
  • 28eab08cMerge branch 'records-hm55' into mainTracker
  • d3edaa05|||PR records: HM55 start, PROCEDURES.mdTracker
  • 3059f86cMerge branch 'records-design-rule' into mainTracker
  • 421a4809|||PR records: his-design rule (Apollo 2026-11-13)Tracker
  • d1390692Merge branch 'records-dp75b' into mainTracker
  • a4d1a7d2|||PR records: later steps checked, branch auditTracker
  • e070e16fMerge branch 'records-dp75' into mainTracker
  • 642b4fa8|||PR records: DP75 day62 live, AP62 briefTracker
  • bfc4ea4dMerge branch 'ap62' into mainTracker
  • 2c95ac46|||PR AP62: re-vendor Hybriel set day62 (source 70341ad2, bin a54f5f08)Tracker
  • b9c7c3c8Merge branch 'records-dp74' into mainTracker
  • 85cfb4ae|||PR records: AP61 day61, DP74 liveTracker