tracker
All repositories: gitoria
2.5 KB
// tools/count-incomplete.hl — tracker#33 (mission 029): how many titles are still REDUCED. ONLY on a COPY or a stopped app (opening// a table rewrites its files; hl:mpackdb: one process per storage):// TRACKER_STORAGE=$PWD/.scratch/<copy>/storage/mpackdb ./bin/hybriel tools/count-incomplete.hl [--list]// Counts every live (not merged) non-adult title the details repair still has to do (details.hl needsDetails = shows.hl// isIncomplete: TMDB's details never went through this app) — by type and origin (migrated / filmography fill / search import)// and by what its page misses (shows.hl missingParts). Then the COMPLETE titles that still miss a part — TMDB has none (The// Remaining: no poster, no IMDb id). The last line is the answer: `reduced titles: N` (0 after the repair). `--list` also prints// every reduced title (type, slug, missing parts). A title whose adult flag is still unknown (adult backfill: TMDB 404) is// counted too, apart — its completion asks TMDB once more (404 → `detailsCheck`, adult → the flag; never shown either way).import { args } from 'hl:proc'import { allShows, missingParts } from '../lib/shows.hl'import { needsDetails } from '../lib/details.hl'list = args().includes('--list')reduced = {}missing = {}completeMissing = {}let total = 0let n = 0let adult = 0for (s of allShows()) {if (s.mergedInto == null && s.tmdbId != null) {total = total + 1if (s.adult == true) { adult = adult + 1 }let parts = missingParts(&s)if (needsDetails(&s)) {n = n + 1let origin = s.minimal == true ? 'fill' : (s.oldId != null && ('' + s.oldId).slice(0, 5) == 'tmdb-' ? 'import' : 'migrated')let k = s.type + ' ' + origin + (s.adult == null ? ' (adult flag unknown)' : '')reduced[k] = reduced[k] == null ? 1 : reduced[k] + 1for (p of parts) { missing[p] = missing[p] == null ? 1 : missing[p] + 1 }if (parts.length > 0) { missing['any'] = missing['any'] == null ? 1 : missing['any'] + 1 }if (list) { console.log('reduced ' + s.type + ' ' + s.urlSegment + ' ' + parts.join(',')) }} else if (s.adult != true) {for (p of parts) { completeMissing[p] = completeMissing[p] == null ? 1 : completeMissing[p] + 1 }}}}console.log('titles with a TMDB id: ' + total + ' (adult ' + adult + ', never completed)')for (k of reduced.keys()) { console.log(' reduced ' + k + ': ' + reduced[k]) }console.log(' their pages miss: ' + JSON.stringify(missing))console.log('complete titles missing a part (TMDB has none): ' + JSON.stringify(completeMissing))console.log('reduced titles: ' + n)
Branches
Latest commits
- 45163bd4log: person/tmdb error hypothesismre
- cb38de2blog: swap 503 causemre
- fd10c3d5log: CB livemre
- 7557c025log: CB deploy try 2mre
- 06a7534aMerge branch 'cb'mre
- 2f8030d6log: CB gates greenmre
- 498bf644log: CB gates startmre
- f59c2847gc1: bound the five request caches (shows.hl cacheLimit)mre
- 6ea2c6d6log: morning re-measure 11-04mre
- 446290f0log: GC1 livemre
- 8e6aa91dlog: GC1 deploy retrymre
- 87ad2dc1log: GC1 deployingmre
- 53f10fb8Merge branch 'gc1-deploy'mre
- 7fcbf1d2log: GC1 deploy GOmre
- 1fb6664bcompose: TRACKER_QSTATS=1 (GC1 measurement)mre
- 6576c1cdgc1: release the people-view scan lists once the view is builtmre
- 94f8a373gc1: back out the kept episode-id set (no measurable gain on /my/unwatched: 4.69 -> 4.61 GB per 150 loads)mre
- a1a88bd4gc1: search skips the stale-key string while no entry is stale; /my/unwatched asks a kept id set instead of building a key string per episode rowmre
- cd830744gc1: dbSearch: no split / map / list copy per candidate (scores from the stored text, top list touched only when the hit can enter)mre
- 451db7cdgc1: show page and check clicks read the kept watched set instead of building one from a by-value copy of every watchmre