gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit44b7d9f944b7d9f9tracker#6: /schedule — upcoming episodes of followed shows, soonest firstmre44b7d9f9/follows.hl

1.1 KB

  1. // follows.hl — READ-ONLY per-user follow data (tracker.worldapi.org#5): which shows a user follows.
  2. // storage/mpackdb/follows.db, migrated by tools/migrate.hl (tracker.worldapi.org#2): { show, user, at, oldId }.
  3. // Kept apart from shows.hl (show data) and watches.hl (watch state) so /unwatched and /schedule (tickets #5/#6,
  4. // "reuse, don't copy") can both import the same function.
  5. import { MPackDB } from 'hl:mpackdb'
  6. import { env } from 'hl:proc'
  7. static envOr = (name, fallback) => {
  8. let v = env(name)
  9. return v != null && v.trim() != '' ? v.trim() : fallback
  10. }
  11. static storageDir = envOr('TRACKER_STORAGE', './storage/mpackdb')
  12. static followsTable = new MPackDB(file = storageDir + '/follows.db', primaryKey = '@id', indexes = ['!oldId'])
  13. // the ids of every show this user follows — a linear scan (128 rows total across every user,
  14. // migrated data; cheap once per page load) — no declared index on `user`
  15. static followedShowIds = (userId) => {
  16. if (userId == null) { return [] }
  17. let out = []
  18. for (f of followsTable.find(null, null)) { if (f.user == userId && f.show != null) { out.push(f.show) } }
  19. return out
  20. }

Branches

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