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
- e5c9b659Pack retained search IDs into UTF-8 bytesmre
- 62a5f6c7HM67 brief, HM66 mergedmre
- b32b8440Merge hm66-catalogindex: packed catalog indexmre
- 2db0f7adReport HM66 heap measurements and validationmre
- 6ce15623Pack catalog lists and membership maps in UTF-8 bytesmre
- 71134e21HM66 briefmre
- ed4cbab2status timemre
- e982c26dlog: HM65 mergedmre
- 6e72f9d1Merge hm65-fields: episode boot scan reads three fieldsmre
- 07a5c883HM65 report measured field projection and complete validationmre
- 0eab858fRead only catalog date fields during the episode boot scanmre
- d3179273log: HM65 hl:heap vendoringmre
- cb78a1a0HM65 report missing heap diagnostic package with repromre
- 89606a5cHM65 briefmre
- 096ce0d4log: DP69 live on day48mre
- b3d8a80bDP69 brief, RV48 mergedmre
- ce6d7d32Merge rv48: Hybriel day48mre
- 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
- 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
- 4a802ae7status: RV48 runningmre