gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit73fa20dd73fa20ddMerge hm49b-styles: tracker#49 rest of the component stylesmre73fa20dd/tools/count-external-ids.hl

1.6 KB

  1. // tools/count-external-ids.hl — tracker.worldapi.org#12: how many shows (all / followed) have each external id (tmdbId,
  2. // imdbId, tvdbId, tvmzId), per `type`. ONLY on a COPY or the stopped app (opening a table rewrites its files):
  3. // TRACKER_STORAGE=$PWD/.scratch/realdata/storage/mpackdb ./bin/hybriel tools/count-external-ids.hl
  4. import { env } from 'hl:proc'
  5. import { showsTable } from '../lib/shows.hl'
  6. import { allFollowedShowIds } from '../lib/follows.hl'
  7. followed = {}
  8. for (id of allFollowedShowIds()) { followed[id] = true }
  9. has = (&v) => { return v != null && ('' + v).trim() != '' }
  10. counts = {}
  11. samples = {}
  12. bump = (&key, &show) => {
  13. let c = counts[key] != null ? counts[key] : { shows = 0 tmdbId = 0 imdbId = 0 tvdbId = 0 tvmzId = 0 }
  14. c.shows = c.shows + 1
  15. if (has(&show.tmdbId)) { c.tmdbId = c.tmdbId + 1 }
  16. if (has(&show.imdbId)) { c.imdbId = c.imdbId + 1 }
  17. if (has(&show.tvdbId)) { c.tvdbId = c.tvdbId + 1 }
  18. if (has(&show.tvmzId)) { c.tvmzId = c.tvmzId + 1 }
  19. counts[key] = c
  20. return null
  21. }
  22. for (s of showsTable.find(null, null)) {
  23. let t = s.type != null ? '' + s.type : 'null'
  24. bump('all ' + t, &s)
  25. if (followed[s.id] == true) { bump('followed ' + t, &s) }
  26. if (samples[t] == null) { samples[t] = 'tmdbId=' + s.tmdbId + ' (' + hlTypeName(s.tmdbId) + ') imdbId=' + s.imdbId + ' (' + hlTypeName(s.imdbId) + ') tvdbId=' + s.tvdbId + ' (' + hlTypeName(s.tvdbId) + ') tvmzId=' + s.tvmzId + ' (' + hlTypeName(s.tvmzId) + ')' }
  27. }
  28. for (k of counts.keys()) {
  29. let c = counts[k]
  30. print(k + ': shows=' + c.shows + ' tmdbId=' + c.tmdbId + ' imdbId=' + c.imdbId + ' tvdbId=' + c.tvdbId + ' tvmzId=' + c.tvmzId)
  31. }
  32. for (k of samples.keys()) { print('sample ' + k + ': ' + samples[k]) }

Branches

Latest commits

  • 73fa20ddMerge hm49b-styles: tracker#49 rest of the component stylesmre
  • 14195720log: HM49B done, HM51 startedmre
  • 78ee6b56Move remaining component styles into Style blocksmre
  • 7f04de33log: HM49Bmre
  • 00616cf3log: #49 batch merged, DP67 startedmre
  • d7232e86Merge hm49-styles: tracker#49 first batch of component stylesmre
  • 079f376dMove seven components' styles into Style blocksmre
  • 17d66feelog: #58 mergedmre
  • 69a6640bMerge hm58-map: tracker#58 project.hl only the mapmre
  • a85f7900Move route logic out of the project mapmre
  • 13dea5belog: #56 live, HM49 and HM58 startedmre
  • a31c8f2fdocs: tracker#36 remaining listmre
  • 975d06d1log: #36 live, DP66 startedmre
  • d6d03fa3mission: T36Bmre
  • e7512d00status: #36 rolled back, retry askedmre
  • c98e2043log: T36A rollbackmre
  • ae905f15Merge t36a: tracker#36 apply rechecks, reportmre
  • 796bfaceT36A: report validated fixes, failed live SSH check and verified rollbackmre
  • 55257852log: #53 live, #56 mergedmre
  • 78b39f1bMerge hm56-rows: tracker#56 list builders insert oncemre