gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchrecords-dp75642b4fa8|||PR records: DP75 day62 live, AP62 briefTrackerrecords-dp75/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. 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. 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. 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. 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

  • 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
  • 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