gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit7557c0257557c025log: CB deploy try 2mre7557c025/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

  • 7557c025log: CB deploy try 2mre
  • 06a7534aMerge branch 'cb'mre
  • 2f8030d6log: CB gates greenmre
  • 498bf644log: CB gates startmre
  • f59c2847gc1: bound the five request caches (shows.hl cacheLimit)mre
  • 6ea2c6d6log: morning re-measure 11-04mre
  • 446290f0log: GC1 livemre
  • 8e6aa91dlog: GC1 deploy retrymre
  • 87ad2dc1log: GC1 deployingmre
  • 53f10fb8Merge branch 'gc1-deploy'mre
  • 7fcbf1d2log: GC1 deploy GOmre
  • 1fb6664bcompose: TRACKER_QSTATS=1 (GC1 measurement)mre
  • 6576c1cdgc1: release the people-view scan lists once the view is builtmre
  • 94f8a373gc1: back out the kept episode-id set (no measurable gain on /my/unwatched: 4.69 -> 4.61 GB per 150 loads)mre
  • a1a88bd4gc1: search skips the stale-key string while no entry is stale; /my/unwatched asks a kept id set instead of building a key string per episode rowmre
  • cd830744gc1: dbSearch: no split / map / list copy per candidate (scores from the stored text, top list touched only when the hit can enter)mre
  • 451db7cdgc1: show page and check clicks read the kept watched set instead of building one from a by-value copy of every watchmre
  • ddb4127egc1: TRACKER_QSTATS=1 logs queue and cache sizes every 10 s (measurement only)mre
  • da60547fstatus: GC1 done, backup bugmre
  • e4171021log: GC1 result, backup hard-link bugmre