gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6c1936f96c1936f9log+status: GC planmre6c1936f9/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. let file = s.oldId != null && s.image != null && s.image != '' ? dir + '/posters/' + s.oldId + '.' + s.image : null
  21. let 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. let slug = line.trim()
  31. if (slug != '') {
  32. n = n + 1
  33. let 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. let 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

  • 6c1936f9log+status: GC planmre
  • 2846a840log: m569 result, GC hypothesismre
  • b24cd2d5log: Anton on hl:fetch, mission 569mre
  • 7d42cac1log+status: SL1 measured, fetch stalls remainmre
  • 8e5f2ceflog: SL1 deployedmre
  • 29f34212log: SL1 deploy startedmre
  • 529dd741Merge sl1-slices: slice details repair and person fill (SL1)mre
  • 8a83316blog: SL1 result, session drain slowermre
  • 35e93e8dSL1: slice the details repair and person fill: catalog lists changed in place, 40 ms fill steps, people created in steps, writes one table per tickmre
  • 72c9119flog+status: SL1 startedmre
  • d74620fcmission SL1: slice repair and person fillmre
  • 5d542d73log+status: ST1 resultmre
  • 3945eb81ST1: stall diagnosis reportmre
  • 404733aclog: ST1 startedmre
  • 3e3d5a55mission ST1: stall diagnosismre
  • 9c3180eblog+status: RV28d measured after deploymre
  • fdf10b1alog: RV28d deployed on day38bmre
  • 320005e9log: RV28d merged, deploy runningmre
  • a8fef27dRV28d: reportmre
  • 2bae8373RV28d: re-vendor Hybriel set day38b (source 1e554d75, bin 5ff2a46d)mre