gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit03bbfba303bbfba3Log: AP56c causemre03bbfba3/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

  • 03bbfba3Log: AP56c causemre
  • 24845fe3Log: AP56b result, AP56cmre
  • 6a6d71eaLog: gitoria membershipmre
  • 8b842dc8Log + CONDUCTOR: gitoria PR switch-onmre
  • 6bb7c20estatus: window 2026-11-09mre
  • 5db84974Log: Apollo window GO, AP56b started, BS1 copy removedmre
  • e84586a7Mission AP56bmre
  • 15917f03Record PR workflow rule (gitoria#50)mre
  • 942ac995status: paused workers statemre
  • 44b934e5log: respawn cleanupmre
  • 03a80097Log: Anton GC A/Bmre
  • c7cdef62Log: Apollo STOP, workers pausedmre
  • d0c083fbLog: usage stopmre
  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
  • 1eb6f1a1Missions AP56, BS1mre
  • 4871f8adLog: AP52 live on day52, browser gate greenmre
  • d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
  • c4a60ef2Log: RT52 retest passed, AP52 startedmre
  • 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
  • 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre