tracker
All repositories: gitoria
2.1 KB
// tools/count-tmdb-ids.hl — mission 025: titles sharing a TMDB id. ONLY on a COPY (opening a table rewrites its files):// TRACKER_STORAGE=$PWD/.scratch/<copy>/storage/mpackdb ./bin/hybriel tools/count-tmdb-ids.hl// Prints movies with a TV status / season counts (the old #9 /tv/ bug, shows.hl hasTvLeftovers), the status histogram of// movies, every type+tmdbId held by more than one record (same or DIFFERENT title) and the totals.import { allShows } from '../lib/shows.hl'st = {}let movies = 0let cnt = 0byKey = {}anyKey = {}let merged = 0for (s of allShows()) {// tracker#31 (mission 026): a merged tombstone (merge.hl) holds no tmdbId any more (it is in mergedTmdbId) — counted apartif (s.mergedInto != null) { merged = merged + 1 }if (s.type == 'movie') {movies = movies + 1k = '' + s.statusst[k] = st[k] == null ? 1 : st[k] + 1if (s.seasonsCount != null || s.episodesCount != null) { cnt = cnt + 1 }if (s.status == 'Ended' || s.status == 'Returning Series' || s.status == 'Pilot') { console.log('TV status on movie: ' + s.title + ' ' + s.status + ' tmdb ' + s.tmdbId + ' detailsAt ' + s.detailsAt) }}if (s.tmdbId != null) {k = s.type + ':' + s.tmdbIdlet l = byKey[k]if (l == null) { l = [] }l.push(s.title + ' [' + s.urlSegment + ']')byKey[k] = la = '' + s.tmdbIdlet m = anyKey[a]if (m == null) { m = [] }m.push(s.type + ' ' + s.title)anyKey[a] = m}}console.log('movies ' + movies + ', with seasonsCount/episodesCount ' + cnt)for (k of st.keys()) { console.log(' status ' + k + ': ' + st[k]) }let dups = 0let diff = 0for (k of byKey.keys()) {l = byKey[k]if (l.length > 1) {dups = dups + 1let same = truefor (t of l) { if (t.split(' [')[0] != l[0].split(' [')[0]) { same = false } }if (!same) { diff = diff + 1 }console.log('DUP ' + k + ' ' + (same ? 'same title' : 'DIFFERENT') + ': ' + l.join(' | '))}}let cross = 0for (k of anyKey.keys()) { if (anyKey[k].length > 1) { cross = cross + 1 } }console.log('merged tombstones: ' + merged)console.log('same type+tmdbId shared: ' + dups + ' ids, with different titles: ' + diff + '; any type sharing a number: ' + cross)
Branches
Latest commits
- 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
- 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
- 613ae0ecMerge branch 'bs3' into mainTracker
- 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
- 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
- 310613f1Merge branch 'records-dp72' into mainTracker
- 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
- c41587d2Merge branch 'bs2' into mainTracker
- 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
- 019d5cedMerge branch 'records-1110' into mainTracker
- f88ae8b9|||PR records: day56 toggle live, reviewTracker
- b6b3bb4dMerge branch 'ap56e' into mainTracker
- 29a26da9|||PR AP56e: guard hidden show helpers during session syncTracker