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
- b6b3bb4dMerge branch 'ap56e' into mainTracker
- 29a26da9|||PR AP56e: guard hidden show helpers during session syncTracker
- 7c9ec236|||PR AP56e: re-vendor Hybriel set day56 (source 36ae83a8, bin c1f595a2)Tracker
- 4b54f6f9Merge branch 'records-audit' into mainTracker
- cab4a3bc|||PR records: branch audit, PR-onlyTracker
- 641e1c4cMerge branch 'records-dp71' into mainTracker
- 85a6e9f5|||PR records: DP71 checked in ChromeTracker
- f5be5f18records: gitoria PR-only planTracker
- 46a37036records: DP71 liveTracker
- 3bcb7039Status/log: DP71 in progressTracker
- 5b3a5693Log: SR1b merged via PR 2, DP71 startedTracker
- 783957c2Merge branch 'sr1-search' into mainTracker
- 792b9652README: search results come from the routeTracker
- fd8570b1|||PR search: one server exchange per keystrokeTracker
- e8f5cbcaLog: SR1 result, SR1bTracker
- 8ad275a4Log/status: tracker 68, SR1Tracker
- f5a06a0fLog: gitoria push setup, SR1Tracker
- d6b109baMission SR1mre
- 608b7558Log: FF1 merged via PR #1mre
- 2939d94cMerge branch 'ff1-gate-failfast' into mainTracker