gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite347fef4e347fef4Merge rv44: tracker#61 #62 on Hybriel day44mree347fef4/tools/count-tmdb-ids.hl

2.1 KB

  1. // tools/count-tmdb-ids.hl — mission 025: titles sharing a TMDB id. ONLY on a COPY (opening a table rewrites its files):
  2. // TRACKER_STORAGE=$PWD/.scratch/<copy>/storage/mpackdb ./bin/hybriel tools/count-tmdb-ids.hl
  3. // Prints movies with a TV status / season counts (the old #9 /tv/ bug, shows.hl hasTvLeftovers), the status histogram of
  4. // movies, every type+tmdbId held by more than one record (same or DIFFERENT title) and the totals.
  5. import { allShows } from '../lib/shows.hl'
  6. st = {}
  7. let movies = 0
  8. let cnt = 0
  9. byKey = {}
  10. anyKey = {}
  11. let merged = 0
  12. for (s of allShows()) {
  13. // tracker#31 (mission 026): a merged tombstone (merge.hl) holds no tmdbId any more (it is in mergedTmdbId) — counted apart
  14. if (s.mergedInto != null) { merged = merged + 1 }
  15. if (s.type == 'movie') {
  16. movies = movies + 1
  17. let k = '' + s.status
  18. st[k] = st[k] == null ? 1 : st[k] + 1
  19. if (s.seasonsCount != null || s.episodesCount != null) { cnt = cnt + 1 }
  20. 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) }
  21. }
  22. if (s.tmdbId != null) {
  23. let k = s.type + ':' + s.tmdbId
  24. let l = byKey[k]
  25. if (l == null) { l = [] }
  26. l.push(s.title + ' [' + s.urlSegment + ']')
  27. byKey[k] = l
  28. let a = '' + s.tmdbId
  29. let m = anyKey[a]
  30. if (m == null) { m = [] }
  31. m.push(s.type + ' ' + s.title)
  32. anyKey[a] = m
  33. }
  34. }
  35. console.log('movies ' + movies + ', with seasonsCount/episodesCount ' + cnt)
  36. for (k of st.keys()) { console.log(' status ' + k + ': ' + st[k]) }
  37. let dups = 0
  38. let diff = 0
  39. for (k of byKey.keys()) {
  40. let l = byKey[k]
  41. if (l.length > 1) {
  42. dups = dups + 1
  43. let same = true
  44. for (t of l) { if (t.split(' [')[0] != l[0].split(' [')[0]) { same = false } }
  45. if (!same) { diff = diff + 1 }
  46. console.log('DUP ' + k + ' ' + (same ? 'same title' : 'DIFFERENT') + ': ' + l.join(' | '))
  47. }
  48. }
  49. let cross = 0
  50. for (k of anyKey.keys()) { if (anyKey[k].length > 1) { cross = cross + 1 } }
  51. console.log('merged tombstones: ' + merged)
  52. console.log('same type+tmdbId shared: ' + dups + ' ids, with different titles: ' + diff + '; any type sharing a number: ' + cross)

Branches

Latest commits

  • e347fef4Merge rv44: tracker#61 #62 on Hybriel day44mre
  • 8274bcf1log: RV44 done, deploy held for the usage windowmre
  • 1ef7a3b1RV44: report day44 gates and migration/restart proofsmre
  • a5f62f6cRV44: re-vendor Hybriel set day44 (source 222edef7, bin 4f0f263e)mre
  • 6159a248Merge branch 'hm62-personindex' into rv44mre
  • a8923d93log: RV44 startedmre
  • cf28cf77mission RV44mre
  • 585782dfLog: tracker#60 Chrome look, STATUS rewrittenmre
  • 147d0172conductor: caramboleyo is the user, not owner/creatorApollo
  • 21dd0cfblog: #60 live measurement, reviewmre
  • 7793cf94HM62b report: person indexes with fixed mpackdbmre
  • b4c8d3a9Document tracker#62 fixed-index migration and GC proofmre
  • 09d66ed5status: #60 livemre
  • 4171672flog: #60 livemre
  • f52862a2log: HM62b startedmre
  • 88fde2c4mission HM62bmre
  • a722e526log: #62 blocked by hybriel#317mre
  • 074a7418log: #62 assigned to Tracker; pending rulemre
  • 06f6ae8fHM62 report: mpackdb index gapmre
  • 66f83de3WIP tracker#62 native person indexes blocked by schema migration gapmre