tracker
All repositories: gitoria
2.5 KB
// tools/check-public-slugs.hl — mission 056, the REAL-DATA check (not the gate). ONLY on a COPY or a stopped app (one process// per storage, hybriel#21). Reads SLUGS (a file: the /shows/<slug> slugs that tests/realdata-056.mjs collected from the// public pages, separated by single spaces — hl strings have no newline escape) and prints how many are adult true / false// / unknown / missing; then the adult titles a user follows (USER_ID, optional) and the poster files of adult vs other titles.// TRACKER_STORAGE=$PWD/.scratch/realdata/storage/mpackdb SLUGS=/tmp/w056/real/slugs.txt USER_ID=0mujqspn0aqb ./bin/hybriel tools/check-public-slugs.hlimport { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'import { readFile, exists } from 'hl:fs'dir = env('TRACKER_STORAGE')shows = new MPackDB(file = dir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])follows = new MPackDB(file = dir + '/follows.db', primaryKey = '@id', indexes = ['!oldId'])bySlug = {}byId = {}adultPosters = 0adultNoPoster = 0otherPosters = 0for (s of shows.find(null, null)) {bySlug[s.urlSegment] = sbyId[s.id] = sfile = s.oldId != null && s.image != null && s.image != '' ? dir + '/posters/' + s.oldId + '.' + s.image : nullhas = file != null && exists(file)if (s.adult == true) { if (has) { adultPosters = adultPosters + 1 } else { adultNoPoster = adultNoPoster + 1 } } else if (has) { otherPosters = otherPosters + 1 }}slugFile = env('SLUGS')if (slugFile != null && slugFile != '') {counts = { notAdult = 0 adult = 0 unknown = 0 missing = 0 }bad = []let n = 0for (line of readFile(slugFile).split(' ')) {slug = line.trim()if (slug != '') {n = n + 1s = bySlug[slug]if (s == null) { counts.missing = counts.missing + 1 bad.push('missing ' + slug) }else if (s.adult == false) { counts.notAdult = counts.notAdult + 1 }else if (s.adult == true) { counts.adult = counts.adult + 1 bad.push('ADULT ' + slug) }else { counts.unknown = counts.unknown + 1 bad.push('unknown ' + slug) }}}print('slugs=' + n + ' notAdult=' + counts.notAdult + ' adult=' + counts.adult + ' unknown=' + counts.unknown + ' missing=' + counts.missing)for (b of bad) { print(' ' + b) }}uid = env('USER_ID')if (uid != null && uid != '') {for (f of follows.find(null, null)) {s = byId[f.show]if (f.user == uid && s != null && s.adult == true) { print('followed adult: ' + s.urlSegment + ' (' + s.title + ')') }}}print('posters: adult titles with a file=' + adultPosters + ' without=' + adultNoPoster + '; other titles with a file=' + otherPosters)
Branches
Latest commits
- 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
- b1496147Merge branch 'ap61' into mainTracker
- 2047955bMerge branch 'u12-gateports' into mainTracker
- c8da40f3|||PR AP61: re-vendor Hybriel set day61 (source a05af47c, bin a11042e5)Tracker
- 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
- 0b86324aMerge branch 'records-dp73' into mainTracker