tracker
All repositories: gitoria
1.9 KB
// tools/count-duplicate-episodes.hl — tracker#39 (mission 032): DOUBLE EPISODES — live episodes of one series that share season +// episode number (merge.hl merges them at the app's start). Read-only; run with the app STOPPED or on a copy (hybriel#21).// TRACKER_STORAGE=<mpackdb> ./bin/hybriel tools/count-duplicate-episodes.hl [--list]// → `duplicate episodes: extra=N (season 0: M) in K series; same tmdbId twice in a series: T; merged episode tombstones: X`// (extra = episodes beyond the first of each number); --list adds one line per series: `DUP <title> (<shortId>) <n> extra`import { args } from 'hl:proc'import { showsTable, seasonsTable, episodesTable } from '../lib/shows.hl'list = args().includes('--list')let extra = 0let extra0 = 0let series = 0let sameTmdb = 0let tombstones = 0for (s of showsTable.iterate(null, null)) {if (s.type == 'series' && s.mergedInto == null && s.seasons != null) {let seen = {}let tm = {}let mine = 0for (sid of s.seasons) {let se = seasonsTable.fetch(sid)if (se != null && se.mergedInto == null) {for (eid of se.episodes) {let e = episodesTable.fetch(eid)if (e != null && e.mergedInto == null) {let k = se.seasonNumber + 'x' + e.episodeNumberif (seen[k] == true) {mine = mine + 1if (se.seasonNumber == 0) { extra0 = extra0 + 1 }} else { seen[k] = true }if (e.tmdbId != null) {if (tm['' + e.tmdbId] == true) { sameTmdb = sameTmdb + 1 }tm['' + e.tmdbId] = true}}}}}if (mine > 0) {extra = extra + mineseries = series + 1if (list) { console.log('DUP ' + s.title + ' (' + s.shortId + ') ' + mine + ' extra') }}}}for (e of episodesTable.iterate(null, null)) { if (e.mergedInto != null) { tombstones = tombstones + 1 } }console.log('duplicate episodes: extra=' + extra + ' (season 0: ' + extra0 + ') in ' + series + ' series; same tmdbId twice in a series: ' + sameTmdb + '; merged episode tombstones: ' + tombstones)
Branches
Latest commits
- b0412957Tracker: RV28b handed overmre
- 456940c8Tracker: RULINGS pathmre
- b87a8fdcTracker: worldapi-conductor paths backmre
- 641f3b54Tracker: Apollo answermre
- 8b3cbddaTracker: status, TR7 fix livemre
- ec30162aTracker: TR7 fix livemre
- 54cbec80compose: ignore SIGPIPE (TR7 crash loop, exit 141)mre
- 3e164b63Tracker: status after CL1mre
- 9d686bb3Tracker: CL1 reviewedmre
- b8bba562CL1: crash loop report (SIGPIPE confirmed, trap wrapper option)mre
- 298785f2Tracker: CL1 startedmre
- 36b22710Tracker: port slot, CL1 briefmre
- a401190fTracker: GO for the crash loopmre
- e195d372Tracker: token pathsmre
- 7f541d11Tracker conductor: CONDUCTOR.md, short STATUS.md, old status + decisions archive to archive/2026-10-31mre
- 8dd423f7README: login.js stays by caramboleyo's explicit rulemre
- d8df1493tracker: standby service on port 45018 and a gap-free hand-over in deploy.sh step 4mre
- 36dd1686ident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
- ff9b838etracker: the Ended status pill uses the same red as layouts (pill danger); gate updatedmre
- 40d9719eTP2: LOG line and report for the tracker pillsmre