tracker
All repositories: gitoria
1.1 KB
// follows.hl — READ-ONLY per-user follow data (tracker.worldapi.org#5): which shows a user follows.// storage/mpackdb/follows.db, migrated by tools/migrate.hl (tracker.worldapi.org#2): { show, user, at, oldId }.// Kept apart from shows.hl (show data) and watches.hl (watch state) so /unwatched and /schedule (tickets #5/#6,// "reuse, don't copy") can both import the same function.import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'static envOr = (name, fallback) => {let v = env(name)return v != null && v.trim() != '' ? v.trim() : fallback}static storageDir = envOr('TRACKER_STORAGE', './storage/mpackdb')static followsTable = new MPackDB(file = storageDir + '/follows.db', primaryKey = '@id', indexes = ['!oldId'])// the ids of every show this user follows — a linear scan (128 rows total across every user,// migrated data; cheap once per page load) — no declared index on `user`static followedShowIds = (userId) => {if (userId == null) { return [] }let out = []for (f of followsTable.find(null, null)) { if (f.user == userId && f.show != null) { out.push(f.show) } }return out}
Branches
- mainmain branch
Latest commits
- 44b7d9f9tracker#6: /schedule — upcoming episodes of followed shows, soonest firstmre
- 91c9fc8ctracker#5: /unwatched — unwatched released episodes of followed shows, newest firstmre
- a97c0295tracker#4: show page /shows/:slug (header, seasons, episodes, watch checks) + tools/relink-episode-seasons.hlmre
- 05f407c5tracker: no border on any button except inverted ones (Log out, ident status and identities too); header brand weight 100mre
- 17375427tracker#2: tools/migrate.hl + tools/verify.hl — old MongoDB data into mpackdb with new idsmre
- 31aac936tracker#3: no border on the header and on filled buttons; inverted buttons keep theirsmre
- 2ad9d29ctracker#1: login exactly like calendar (identity selector in the header, empty homepage)mre
- 3691e176tracker#1: empty tracker with the ident login (state of 2026-09-27)mre