gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit57d1c0dc57d1c0dcLog: day50 retest requestmre57d1c0dc/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. 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. 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. 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

  • 57d1c0dcLog: day50 retest requestmre
  • 60b1f419Log: Anton #336 result, wake checkmre
  • 919a18aalog: scratchmre
  • 6b504440status tidymre
  • 9332bd10log: DP70 livemre
  • be11daa0DP70 brief fixmre
  • 886a7028DP70 brief, HM67 mergedmre
  • b41cdd6dMerge hm67-searchids: packed search IDsmre
  • 385904eaReport HM67 matched heap measurements and gate proofmre
  • e5c9b659Pack retained search IDs into UTF-8 bytesmre
  • 62a5f6c7HM67 brief, HM66 mergedmre
  • b32b8440Merge hm66-catalogindex: packed catalog indexmre
  • 2db0f7adReport HM66 heap measurements and validationmre
  • 6ce15623Pack catalog lists and membership maps in UTF-8 bytesmre
  • 71134e21HM66 briefmre
  • ed4cbab2status timemre
  • e982c26dlog: HM65 mergedmre
  • 6e72f9d1Merge hm65-fields: episode boot scan reads three fieldsmre
  • 07a5c883HM65 report measured field projection and complete validationmre
  • 0eab858fRead only catalog date fields during the episode boot scanmre