tracker
All repositories: gitoria
3.5 KB
// tests/realdata-m026-counts.hl — mission 026 (tracker#31), NOT the gate: the numbers before/after the duplicate merge on a COPY of// live storage (opening a table rewrites its files — never the live folder; app stopped):// TRACKER_STORAGE=<copy>/storage/mpackdb ./bin/hybriel tests/realdata-m026-counts.hl// The creator's (TRACKER_IDENTITY, default az5b2) follows and watches: rows (none is ever deleted) and live ones (show/target set),// by kind; titles per type+tmdbId held by more than one live record; tombstones; seasons naming a title that does not list them// (with episodes / with a listed twin = what the merge works on); Reacher's listed season 3 and how many of its episodes the// creator watched; Archive 81's live records.import { showsTable, seasonsTable, episodesTable } from '../lib/shows.hl'import { followsTable } from '../lib/follows.hl'import { watchesTable } from '../lib/watches.hl'import { usersTable } from '../lib/users.hl'import { env } from 'hl:proc'ident = env('TRACKER_IDENTITY') != null ? env('TRACKER_IDENTITY') : 'az5b2'let uid = nullfor (u of usersTable.find(null, null)) { if (u.identity == ident) { uid = u.id } }let fRows = 0let fLive = 0for (f of followsTable.find(null, null)) { if (f.user == uid) { fRows = fRows + 1 if (f.show != null) { fLive = fLive + 1 } } }let wRows = 0let wLive = 0byType = {}mine = {}for (w of watchesTable.find(null, null)) {if (w.user == uid) {wRows = wRows + 1if (w.target != null) {wLive = wLive + 1byType[w.targetType] = byType[w.targetType] == null ? 1 : byType[w.targetType] + 1mine[w.target] = true}}}console.log('user ' + ident + ' = ' + uid + ': follows rows=' + fRows + ' live=' + fLive + '; watches rows=' + wRows + ' live=' + wLive + ' ' + JSON.stringify(byType))byKey = {}let tomb = 0listedBy = {}let reacher = nulllet archive = 0for (s of showsTable.find(null, null)) {if (s.mergedInto != null) { tomb = tomb + 1 } else {for (x of (s.seasons == null ? [] : s.seasons)) { listedBy[x] = s.id }if (s.tmdbId != null) {let k = s.type + ':' + s.tmdbIdbyKey[k] = byKey[k] == null ? 1 : byKey[k] + 1}if (s.title == 'Reacher' && s.type == 'series') { reacher = s }if (s.title == 'Archive 81') { archive = archive + 1 }}}let dups = 0let dupRecords = 0for (k of byKey.keys()) { if (byKey[k] > 1) { dups = dups + 1 dupRecords = dupRecords + byKey[k] } }listedNum = {}all = seasonsTable.find(null, null)for (x of all) { if (listedBy[x.id] != null) { listedNum[listedBy[x.id] + '#' + x.seasonNumber] = true } }let stray = 0let strayWork = 0let mergedSeasons = 0for (x of all) {if (x.mergedInto != null) { mergedSeasons = mergedSeasons + 1 }else if (x.show != null && listedBy[x.id] == null) {stray = stray + 1if ((x.episodes != null && x.episodes.length > 0) || listedNum[x.show + '#' + x.seasonNumber] == true) { strayWork = strayWork + 1 }}}console.log('live type+tmdbId held by more than one record: ' + dups + ' (' + dupRecords + ' records); tombstones: ' + tomb + '; Archive 81 live records: ' + archive)console.log('stray seasons (naming a live title, not in its list): ' + stray + ', of them with episodes or a listed twin: ' + strayWork + '; merged seasons: ' + mergedSeasons)if (reacher != null) {for (sid of reacher.seasons) {let s = seasonsTable.fetch(sid)let w = 0for (e of s.episodes) { if (mine[e] == true) { w = w + 1 } }console.log('Reacher listed S' + s.seasonNumber + ' ' + s.id + ' (' + s.oldId + '): ' + s.episodes.length + ' episodes, watched by ' + ident + ': ' + w + (mine[s.id] == true ? ', season checked' : ''))}}
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