gitoriaLog in with ident

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit20e09d8920e09d89Merge t18 (tracker#18 delta sync) into main (mission 070): conflicts README/STATUS/show.hl/project.hl/browser.mjs, both sides kept; pageShowOf summary = summaryOfmre20e09d89/project.hl

38.5 KB

  1. // project.hl — tracker.worldapi.org: STEP 1 (tracker.worldapi.org#1), an empty shell. Login copied unchanged from
  2. // calendar.worldapi.org (rejected once for a centered sign-in and no header selector — architect, 2026-09-27):
  3. // ident only, no own passwords (README "How apps use ident" of ident.worldapi.org), the identity selector in the
  4. // header (components/main.hl). No shows, no data yet — later steps come from the creator (CONCEPT.md).
  5. //
  6. // the header's ident-selector / "Log in with ident" -> <ident>/login?key=&return=<this app>/login/callback
  7. // /login/callback?ident_code=<code> the app's server exchanges the code for the identity's short id
  8. // (POST <ident>/api/exchange) and signs this app's OWN session in
  9. // (session.user = { id = <users @id> }, users.hl)
  10. // the header's "Log out" button signs this app's session out via the face trackerLogOut (components/main.hl)
  11. // — ident's own session, and the browser's ident cookie, are untouched
  12. //
  13. // Config (env; no committed secret — the first deploy registers this app in ident and sets these, done by the
  14. // architect, as with ident's own .env for SMTP):
  15. // TRACKER_PORT (45008), TRACKER_URL (this app's own public address, for the return URL),
  16. // IDENT_URL (https://ident.worldapi.org), TRACKER_KEY (pk_…), TRACKER_SECRET (sk_…)
  17. import WebFramework from 'hl:web'
  18. import { Response } from 'hl:http1'
  19. import { randomBytes } from 'hl:crypto'
  20. import { env } from 'hl:proc'
  21. import { readBytes, readFile, exists } from 'hl:fs'
  22. import { now, timestamp, every } from 'hl:time'
  23. import Styles from './styles.hl'
  24. import { exchangeCode, ensureUser } from './users.hl'
  25. import Home from './components/home.hl'
  26. import LoginFailed from './components/loginfailed.hl'
  27. import Show from './components/show.hl'
  28. import Unwatched from './components/unwatched.hl'
  29. import Schedule from './components/schedule.hl'
  30. import MyShows from './components/myshows.hl'
  31. import MyMovies from './components/mymovies.hl'
  32. import Movies from './components/movies.hl'
  33. import AllShows from './components/allshows.hl'
  34. import Search from './components/search.hl'
  35. import Person from './components/person.hl'
  36. import Genre from './components/genre.hl'
  37. import { ensureIndex, searchTitleChanged, searchTitleRenamed } from './search.hl'
  38. import { syncEnabled, syncShow, syncShowDelta, persistSync, emptyTotals, addTotals, totalsLine, pauseMsAfter, msPerRequest, adultBackfillQueue, backfillTitle } from './tmdbsync.hl'
  39. import { detailsRepairQueue, completeStep, completeLine, persistDetails, persistCredits, applySynced, creditsQueue, creditsStep } from './details.hl'
  40. import { planStart, planStep, planIds, planLine, markSynced, clearCopiedSummaries, isFollowedInRun } from './deltasync.hl'
  41. import { allFollowedShowIds } from './follows.hl'
  42. import { refreshCatalogShow } from './catalog.hl'
  43. import { ensureShortIds, shortIdStep, shortIdPath, shortIdsLeft, shortIdStats, persistShortIds } from './shortids.hl'
  44. import { guestPersonId } from './people.hl'
  45. import { personById } from './shows.hl'
  46. import { dark, darker } from './shared/tokens.hl'
  47. static appTitle = "tracker"
  48. // ---- THE INSTALLABLE APP (tracker.worldapi.org#10), the same way calendar.worldapi.org does it: hl:web's own web app
  49. // manifest (/__hl/manifest.webmanifest, linked from every head with the apple-touch-icon and theme-color) and service
  50. // worker (/__hl/sw.js) from these settings — no JavaScript of ours. Icons in icons/ (icon.svg is the source, the PNGs
  51. // are rendered from it with rsvg-convert, README "Icons"). The theme colour is the header's background (darker), the
  52. // splash background the page's (dark) — both off the tokens, not written out again.
  53. appThemeColor = darker.value
  54. appBackgroundColor = dark.value
  55. appIcons = [
  56. { src = '/icons/icon-192.png' sizes = '192x192' purpose = 'any' }
  57. { src = '/icons/icon-512.png' sizes = '512x512' purpose = 'any' }
  58. { src = '/icons/icon-192.png' sizes = '192x192' purpose = 'maskable' }
  59. { src = '/icons/icon-512.png' sizes = '512x512' purpose = 'maskable' }
  60. ]
  61. appTouchIcon = '/icons/apple-touch-icon.png'
  62. appFavicon = '/icons/favicon.svg'
  63. // OFFLINE: only the shell — the header and `/` (components/main.hl says "You are offline" while the browser has no
  64. // network). The data pages are not kept: without a network they get hl:web's "Unavailable offline" page.
  65. offline = [ Home ]
  66. styles = Styles
  67. port = env('TRACKER_PORT') != null ? toNumber(env('TRACKER_PORT')) : 45008
  68. watching = env('TRACKER_WATCH') != '0'
  69. // read by hl:web's own manifest config (WebFramework.hl `cfg.sessionDir`), not the constructor call below
  70. sessionDir = env('TRACKER_SESSIONS') != null ? env('TRACKER_SESSIONS') : null
  71. // ---- THE LOGIN BUTTON'S RETURN (ident README "How apps use ident"), copied from calendar.worldapi.org's project.hl
  72. // BACK TO THE PAGE: /login.js puts `?next=` into the button's return URL at the click. Only a same-origin PATH
  73. // goes (one `/`, URL-safe characters, ≤ 500). Anything else → `/`.
  74. nextChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~/?&=%+,;@!$()*:'
  75. safePath = (want) => {
  76. if (want == null || hlTypeName(want) != 'String' || want == '' || want.length > 500) { return '/' }
  77. if (want.slice(0, 1) != '/' || want.slice(0, 2) == '//' || want.slice(0, 7) == '/login/') { return '/' }
  78. let i = 0
  79. while (i < want.length) {
  80. if (!nextChars.includes(want[i])) { return '/' }
  81. i = i + 1
  82. }
  83. return want
  84. }
  85. // A FAILED LOGIN is a page (components/loginfailed.hl): the reason is parked in the session, then → /login/failed
  86. failed = (req, why) => {
  87. let s = req.session
  88. let fresh = s == null
  89. if (fresh) { s = server.sessions.mint() }
  90. s.data.loginError = why
  91. server.sessions.save(s)
  92. let res = new Response('login failed: ' + why, { status = 302 headers = { 'Location' = '/login/failed' 'Cache-Control' = 'no-store' 'Content-Type' = 'text/plain; charset=utf-8' } })
  93. if (fresh) { res.headers['Set-Cookie'] = server.sessions.cookieHeader(s.id) }
  94. return res
  95. }
  96. // the function route gets the cookie's session as req.session (hybriel #11); none yet → minted here
  97. loginCallback = (route, req) => {
  98. if (req.method != 'GET') { return failed(req, 'GET only') }
  99. let q = req.query != null ? req.query : {}
  100. let code = q.ident_code
  101. if (code == null || code == '') { return failed(req, 'ident sent no login code') }
  102. let x = exchangeCode(code)
  103. if (x.error != null) { return failed(req, x.error) }
  104. let u = ensureUser(x.identity)
  105. if (u == null) { return failed(req, 'could not store the user') }
  106. let s = req.session
  107. let fresh = s == null
  108. if (fresh) { s = server.sessions.mint() }
  109. s.user = { id = u.id }
  110. s.data.tag = randomBytes(16)
  111. s.data.loginError = null
  112. server.sessions.save(s)
  113. let res = new Response('logged in', { status = 302 headers = { 'Location' = safePath(q.next) 'Cache-Control' = 'no-store' 'Content-Type' = 'text/plain; charset=utf-8' } })
  114. if (fresh) { res.headers['Set-Cookie'] = server.sessions.cookieHeader(s.id) }
  115. return res
  116. }
  117. // ---- /posters/<name> (tracker.worldapi.org#4): a show's poster image, served dynamically from
  118. // storage/mpackdb/posters/ (the poster's file name is the show's oldId + its migrated extension,
  119. // shows.hl posterName) — falls back to a placeholder svg when the real file isn't there yet (the
  120. // mongo export never included the actual poster bytes, see the report's `open`).
  121. postersDir = (env('TRACKER_STORAGE') != null ? env('TRACKER_STORAGE') : './storage/mpackdb') + '/posters'
  122. placeholderPoster = './assets/poster-placeholder.svg'
  123. posterNameChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_'
  124. isSafePosterName = (name) => {
  125. if (name == null || hlTypeName(name) != 'String' || name == '' || name.length > 100) { return false }
  126. let i = 0
  127. while (i < name.length) {
  128. if (!posterNameChars.includes(name[i])) { return false }
  129. i = i + 1
  130. }
  131. return true
  132. }
  133. endsWithStr = (s, suffix) => { return s.length >= suffix.length && s.slice(s.length - suffix.length) == suffix }
  134. mimeOfPoster = (name) => {
  135. if (endsWithStr(name, '.png')) { return 'image/png' }
  136. if (endsWithStr(name, '.webp')) { return 'image/webp' }
  137. if (endsWithStr(name, '.svg')) { return 'image/svg+xml' }
  138. return 'image/jpeg'
  139. }
  140. posterRoute = (route, req) => {
  141. let name = route.params != null ? route.params.name : null
  142. if (!isSafePosterName(name)) { return new Response('bad poster name', { status = 400 headers = { 'Content-Type' = 'text/plain; charset=utf-8' } }) }
  143. let path = postersDir + '/' + name
  144. if (exists(path)) { return new Response(readBytes(path), { headers = { 'Content-Type' = mimeOfPoster(name) 'Cache-Control' = 'public, max-age=86400' } }) }
  145. return new Response(readBytes(placeholderPoster), { headers = { 'Content-Type' = 'image/svg+xml' 'Cache-Control' = 'public, max-age=3600' } })
  146. }
  147. // ---- /profiles/<name> (tracker.worldapi.org#16): a person's photo, from storage/mpackdb/profiles/ (people.hl syncProfile
  148. // downloads it on the first visit of the person page) — the same checks and placeholder as /posters/<name>
  149. profilesDir = (env('TRACKER_STORAGE') != null ? env('TRACKER_STORAGE') : './storage/mpackdb') + '/profiles'
  150. profileRoute = (route, req) => {
  151. let name = route.params != null ? route.params.name : null
  152. if (!isSafePosterName(name)) { return new Response('bad photo name', { status = 400 headers = { 'Content-Type' = 'text/plain; charset=utf-8' } }) }
  153. let path = profilesDir + '/' + name
  154. if (exists(path)) { return new Response(readBytes(path), { headers = { 'Content-Type' = mimeOfPoster(name) 'Cache-Control' = 'public, max-age=86400' } }) }
  155. return new Response(readBytes(placeholderPoster), { headers = { 'Content-Type' = 'image/svg+xml' 'Cache-Control' = 'public, max-age=3600' } })
  156. }
  157. // ---- the old addresses of the personal lists (tracker.worldapi.org#8): they all live under /my/ now —
  158. // a permanent redirect so old links keep working (architect's decision)
  159. movedTo = (path) => { return new Response('moved to ' + path, { status = 301 headers = { 'Location' = path 'Content-Type' = 'text/plain; charset=utf-8' } }) }
  160. unwatchedMoved = (route, req) => { return movedTo('/my/unwatched') }
  161. scheduleMoved = (route, req) => { return movedTo('/my/schedule') }
  162. // mission 058: the show page's genre pills linked `/genre/<x>` (no page there) — the genre pages are `/genres/<x>`
  163. genreMoved = (route, req) => {
  164. let g = route.params != null ? route.params.genre : null
  165. return movedTo(isSafePosterName(g) ? '/genres/' + g : '/')
  166. }
  167. // mission 060 (tracker.worldapi.org#27): `/<shortId>` → 301 to the title's or person's page (shortids.hl); upper case is
  168. // read as lower case; anything else is a 404
  169. shortIdRoute = (route, req) => {
  170. let sid = route.params != null ? route.params.sid : null
  171. let path = sid != null && hlTypeName(sid) == 'String' ? shortIdPath(sid.toLowerCase()) : null
  172. if (path == null) { return new Response('not found', { status = 404 headers = { 'Content-Type' = 'text/plain; charset=utf-8' } }) }
  173. return movedTo(path)
  174. }
  175. // mission 062: a GUEST STAR's link (components/show.hl castRowsOf) — guests are no person records until someone opens one:
  176. // `/person/tmdb/<tmdbId>?show=<show id>` creates the person (people.hl guestPersonId: name + role from that title, a short id) or
  177. // finds the one we have, then 302 → `/person/<slug>` (the page fills from TMDB as for any new person). A function route: the
  178. // browser loads it itself (hl:web's client router hands every non-component link to the browser)
  179. guestRoute = (route, req) => {
  180. let t = route.params != null ? route.params.tmdb : null
  181. let tmdbId = t != null && hlTypeName(t) == 'String' && t.length <= 10 ? toNumber(t) : null
  182. if (tmdbId == null || tmdbId < 1) { return new Response('not found', { status = 404 headers = { 'Content-Type' = 'text/plain; charset=utf-8' } }) }
  183. let q = req.query != null ? req.query : {}
  184. let r = guestPersonId(tmdbId, q.show)
  185. let p = r.id != null ? personById(r.id) : null
  186. if (p == null || p.urlSegment == null) { return new Response('not found: ' + (r.error != null ? r.error : 'no such person'), { status = 404 headers = { 'Content-Type' = 'text/plain; charset=utf-8' } }) }
  187. return new Response('see /person/' + p.urlSegment, { status = 302 headers = { 'Location' = '/person/' + p.urlSegment 'Cache-Control' = 'no-store' 'Content-Type' = 'text/plain; charset=utf-8' } })
  188. }
  189. routes = [
  190. { pattern = "/favicon.ico" file = "./icons/favicon.ico" headers = { 'Cache-Control' = 'no-cache' } }
  191. // the installable app (tracker.worldapi.org#10): the icons (manifest and service worker are hl:web's own, from appIcons / offline)
  192. { pattern = "/icons/icon-192.png" file = "./icons/icon-192.png" headers = { 'Cache-Control' = 'no-cache' } }
  193. { pattern = "/icons/icon-512.png" file = "./icons/icon-512.png" headers = { 'Cache-Control' = 'no-cache' } }
  194. { pattern = "/icons/apple-touch-icon.png" file = "./icons/apple-touch-icon.png" headers = { 'Cache-Control' = 'no-cache' } }
  195. { pattern = "/icons/favicon.svg" file = "./icons/favicon.svg" headers = { 'Cache-Control' = 'no-cache' } }
  196. { pattern = "/login/callback" function = loginCallback }
  197. { pattern = "/login/failed" component = LoginFailed }
  198. { pattern = "/login.js" file = "./login.js" headers = { 'Cache-Control' = 'no-cache' } }
  199. { pattern = "/posters/:name" function = posterRoute }
  200. // tracker.worldapi.org#13: every movie / every series, 24 per page — the page is a PATH segment (`/movies/page/2`), a
  201. // page component cannot read `?page=` (hybriel#11) — and the movies the user follows
  202. { pattern = "/movies" component = Movies }
  203. { pattern = "/movies/page/:page" component = Movies }
  204. { pattern = "/shows" component = AllShows }
  205. { pattern = "/shows/page/:page" component = AllShows }
  206. { pattern = "/shows/:slug" component = Show }
  207. { pattern = "/my/shows" component = MyShows }
  208. { pattern = "/my/movies" component = MyMovies }
  209. { pattern = "/my/unwatched" component = Unwatched }
  210. { pattern = "/my/schedule" component = Schedule }
  211. { pattern = "/unwatched" function = unwatchedMoved }
  212. { pattern = "/schedule" function = scheduleMoved }
  213. // tracker.worldapi.org#14: the search — `/search/<text>` (hl:web gives a page no query string, so not `?q=`)
  214. { pattern = "/search/:q?" component = Search }
  215. // tracker.worldapi.org#16: a person's page (the show page's cast and the search link here) and their photo
  216. { pattern = "/person/tmdb/:tmdb" function = guestRoute }
  217. { pattern = "/person/:slug" component = Person }
  218. { pattern = "/profiles/:name" function = profileRoute }
  219. // mission 058 (tracker.worldapi.org#25): a genre's movies and series, like /movies (the page in the path)
  220. { pattern = "/genres/:genre" component = Genre }
  221. { pattern = "/genres/:genre/page/:page" component = Genre }
  222. { pattern = "/genre/:genre" function = genreMoved }
  223. { pattern = "/" component = Home }
  224. // mission 060 (tracker.worldapi.org#27): a short id → its page (LAST: every named one-segment route above wins)
  225. { pattern = "/:sid" function = shortIdRoute }
  226. ]
  227. // WHO GETS THE PUSH: the login state reaches the tabs of one session (components/main.hl trackerSignedIn/Out).
  228. tagOf = (session) => { return session != null && session.data != null ? session.data.tag : null }
  229. audience = {
  230. trackerSignedIn = (tag, session) => { return tag != null && tagOf(session) == tag }
  231. trackerSignedOut = (tag, session) => { return tag != null && tagOf(session) == tag }
  232. }
  233. // cookies are per host, not per port: an own name keeps this app's session apart from
  234. // ident's own (and from any other worldapi app sharing a dev host), see ident README "Design
  235. // tokens" / hybriel#10 hybriel#17.
  236. sessionCookie = 'trackersid'
  237. // tracker.worldapi.org#14: the search index (search.hl) is built once here at boot (~0.6 s on the real data), not by the
  238. // first search
  239. searchIndexReady = ensureIndex()
  240. // mission 060: every short id in use (one map over shows AND persons) and the records still without one, before the first request
  241. shortIdsReady = ensureShortIds()
  242. // tracker#18, ONCE (deltasync.hl clearCopiedSummaries): a `summary` that is only the migrated copy of tmdbSummary is cleared — the
  243. // current TMDB text shows; the creator's own texts stay
  244. summariesCleared = clearCopiedSummaries()
  245. if (summariesCleared.ran) { console.log('summaries: cleared ' + summariesCleared.cleared + ' copies of tmdbSummary, kept ' + summariesCleared.kept + ' own texts, errors ' + summariesCleared.errors + ', ' + summariesCleared.ms + ' ms') }
  246. server = new WebFramework(routes = routes, styles = styles, port = port, sessionCookie = sessionCookie, watchMode = watching)
  247. // ---- THE DAILY TMDB SYNC (tracker.worldapi.org#9, tmdbsync.hl; tracker#18, deltasync.hl) -------------------------
  248. // Once a day at TRACKER_SYNC_HOUR (UTC, default 4 — hl:time has no time zones; the container runs UTC). hl:web serves ONE
  249. // request at a time, so the run never takes the server for itself: a 1-second clock does ONE step per tick and returns — the
  250. // requests that queued meanwhile are served between two ticks, and a tick never starts inside a page render.
  251. // tracker#18: the run first asks TMDB's and TVmaze's CHANGE LISTS since the last run (deltasync.hl — one list page per step)
  252. // and then syncs only the titles of ours that changed, followed ones first — every title stays current, not only the followed
  253. // ones. FULL WALK (every followed show, as before #18) on the first run, after a gap > 14 days, or when a change list fails.
  254. // A title's step: tmdbsync.hl syncShow (1–3 TMDB requests + maybe its poster, TVmaze) + details.hl applySynced (the record's
  255. // title, overview, tagline … and cast/crew from the same details answer). After a step that made n requests the next waits
  256. // n × 260 ms (TMDB: ≤ 40 requests / 10 s) + 550 ms per TVmaze request (≤ 20 / 10 s, tracker.worldapi.org#12).
  257. // The finished run stores its day (deltasync.hl markSynced). Log: "tmdb sync: start, …", the change lists ("tmdb sync:
  258. // changes since …"), errors, slow steps, "tmdb sync done: mode=… changeRequests=… <totals>".
  259. // TRACKER_SYNC=0 switches it off; without TMDB_READ_TOKEN it is off too (logged once).
  260. syncHour = env('TRACKER_SYNC_HOUR') != null ? toNumber(env('TRACKER_SYNC_HOUR')) : 4
  261. syncOn = env('TRACKER_SYNC') != '0' && syncEnabled
  262. syncQueue = []
  263. syncPlanning = false
  264. syncMode = ''
  265. syncMark = false
  266. syncChangeRequests = 0
  267. syncAt = 0
  268. syncDay = ''
  269. syncNextAt = 0
  270. syncTotals = emptyTotals()
  271. syncFinish = () => {
  272. persistDetails()
  273. if (syncMark) { markSynced(syncDay) }
  274. console.log('tmdb sync done: mode=' + syncMode + ' changeRequests=' + syncChangeRequests + ' ' + totalsLine(syncTotals) + ' seconds=' + ((now() - syncAt) / 1000))
  275. return null
  276. }
  277. syncTick = () => {
  278. let t = now()
  279. if (syncQueue.length == 0 && !syncPlanning) {
  280. let stamp = timestamp(t)
  281. let day = stamp.slice(0, 10)
  282. if (toNumber(stamp.slice(11, 13)) != syncHour || day == syncDay) { return null }
  283. syncDay = day
  284. syncAt = t
  285. syncNextAt = 0
  286. syncTotals = emptyTotals()
  287. syncChangeRequests = 0
  288. let p = planStart(day, null)
  289. syncMode = p.mode
  290. syncMark = true
  291. if (p.mode == 'delta') {
  292. syncPlanning = true
  293. console.log('tmdb sync: start, changes ' + p.why)
  294. return null
  295. }
  296. syncQueue = allFollowedShowIds()
  297. console.log('tmdb sync: start, ' + syncQueue.length + ' followed shows, full walk (' + p.why + ')')
  298. if (syncQueue.length == 0) { syncFinish() }
  299. return null
  300. }
  301. if (t < syncNextAt) { return null }
  302. if (syncPlanning) {
  303. let ps = planStep()
  304. syncChangeRequests = syncChangeRequests + ps.requests + ps.tvmazeRequests
  305. syncTotals.requests = syncTotals.requests + ps.requests
  306. syncTotals.tvmazeRequests = syncTotals.tvmazeRequests + ps.tvmazeRequests
  307. syncNextAt = now() + pauseMsAfter(ps)
  308. if (!ps.done) { return null }
  309. syncPlanning = false
  310. console.log('tmdb sync: ' + planLine())
  311. if (ps.failed != '') {
  312. // a change list could not be read: the old full walk, and the day is not advanced (the next run asks again)
  313. syncMode = 'full'
  314. syncMark = false
  315. syncQueue = allFollowedShowIds()
  316. console.log('tmdb sync: change list failed, full walk of ' + syncQueue.length + ' followed shows instead')
  317. } else {
  318. syncQueue = planIds()
  319. }
  320. if (syncQueue.length == 0) { syncFinish() }
  321. return null
  322. }
  323. let id = syncQueue[0]
  324. let rest = []
  325. let i = 1
  326. while (i < syncQueue.length) { rest.push(syncQueue[i]) i = i + 1 }
  327. syncQueue = rest
  328. // tracker#18: in a delta run a title nobody follows gets the light step (changed seasons, no TVmaze)
  329. let r = syncMode == 'delta' && !isFollowedInRun(id) ? syncShowDelta(id) : syncShow(id)
  330. // tracker#18 + #28: the record's own fields (title, overview, tagline …) and the cast + crew from the same details answer
  331. if (r.details != null) {
  332. let c = applySynced(id, r.details)
  333. if (c.error != '') { console.log('tmdb sync: ' + c.error) }
  334. if (c.renamed) { searchTitleRenamed(id) }
  335. }
  336. // the public lists (catalog.hl, tracker.worldapi.org#13): this show's place by its newest released episode; the sync
  337. // also brings TMDB's adult flag (mission 054) → the search's view of it too
  338. refreshCatalogShow(id)
  339. searchTitleChanged(id)
  340. let took = now() - t
  341. syncTotals = addTotals(syncTotals, r)
  342. if (r.error != '') { console.log('tmdb sync: ' + r.error) }
  343. // a step blocks every request meanwhile (Saturday Night Live, 53 seasons, 4 requests: ~1.7 s) — say so in the log
  344. if (took > 1500) { console.log('tmdb sync: slow step, show ' + id + ', ' + r.requests + ' requests, ' + took + ' ms') }
  345. syncNextAt = now() + pauseMsAfter(r)
  346. if (syncQueue.length > 0 && syncTotals.shows % 10 == 0) { persistDetails() }
  347. if (syncQueue.length == 0) { syncFinish() }
  348. return null
  349. }
  350. // ---- THE ADULT-FLAG BACKFILL (mission 054, tmdbsync.hl backfillTitle) -----------------------------------
  351. // The public lists and the search show only titles TMDB says are not adult (shows.hl isPublicTitle; unknown = hidden). At
  352. // start the app collects every title whose flag is still unknown and asks TMDB for ONE title per step — like the daily
  353. // sync, on the same clock, so requests queued meanwhile are served between two steps: one details request (adult,
  354. // poster_path, external ids) + the poster file when missing, then a pause of 260 ms per TMDB API request (≤ 40 / 10 s;
  355. // the poster comes from TMDB's image host, not the API, and is not counted). Each answered title goes into the lists
  356. // (catalog.hl refreshCatalogShow) and the search at once. RESUMES after a restart: the queue is built from what is
  357. // still unknown. Stops when the queue is empty; titles TMDB answers 404 for are marked (`adultCheck`) and stay hidden; a
  358. // passing failure (no answer, 429, 5xx) goes to the back of the queue, at most 2 more tries per start.
  359. // While the daily sync runs, the backfill waits. Log: start, every TRACKER_BACKFILL_LOG_EVERY (500) titles, done.
  360. // TRACKER_BACKFILL=0 switches it off; without TMDB_READ_TOKEN it is off too.
  361. backfillOn = env('TRACKER_BACKFILL') != '0' && syncEnabled
  362. backfillLogEvery = env('TRACKER_BACKFILL_LOG_EVERY') != null ? toNumber(env('TRACKER_BACKFILL_LOG_EVERY')) : 500
  363. backfillQueue = null
  364. backfillPos = 0
  365. backfillDone = false
  366. backfillAt = 0
  367. backfillNextAt = 0
  368. backfillTries = {}
  369. backfillTotals = { titles = 0 adult = 0 notAdult = 0 unknown = 0 posters = 0 ids = 0 requests = 0 errors = 0 retries = 0 }
  370. backfillLine = () => {
  371. let b = backfillTotals
  372. return b.titles + '/' + backfillQueue.length + ' titles, adult=' + b.adult + ' notAdult=' + b.notAdult + ' unknown=' + b.unknown + ' posters=' + b.posters
  373. + ' ids=' + b.ids + ' requests=' + b.requests + ' errors=' + b.errors + ' retries=' + b.retries + ' seconds=' + ((now() - backfillAt) / 1000)
  374. }
  375. backfillTick = () => {
  376. if (backfillDone) { return null }
  377. let t = now()
  378. if (backfillQueue == null) {
  379. backfillQueue = adultBackfillQueue()
  380. backfillAt = t
  381. console.log('adult backfill: start, ' + backfillQueue.length + ' titles without an adult flag (' + (now() - t) + ' ms to find them)')
  382. if (backfillQueue.length == 0) { backfillDone = true console.log('adult backfill: nothing to do') }
  383. return null
  384. }
  385. if (t < backfillNextAt) { return null }
  386. let id = backfillQueue[backfillPos]
  387. backfillPos = backfillPos + 1
  388. let r = backfillTitle(id)
  389. if (r.retry && (backfillTries[id] == null || backfillTries[id] < 2)) {
  390. backfillTries[id] = backfillTries[id] == null ? 1 : backfillTries[id] + 1
  391. let q = backfillQueue
  392. q.push(id)
  393. backfillQueue = q
  394. backfillTotals.retries = backfillTotals.retries + 1
  395. } else {
  396. backfillTotals.titles = backfillTotals.titles + 1
  397. if (r.adult == true) { backfillTotals.adult = backfillTotals.adult + 1 } else if (r.adult == false) { backfillTotals.notAdult = backfillTotals.notAdult + 1 } else { backfillTotals.unknown = backfillTotals.unknown + 1 }
  398. }
  399. backfillTotals.posters = backfillTotals.posters + r.posters
  400. backfillTotals.ids = backfillTotals.ids + r.ids
  401. backfillTotals.requests = backfillTotals.requests + r.requests
  402. backfillTotals.errors = backfillTotals.errors + r.errors
  403. if (r.error != '') { console.log('adult backfill: ' + r.error) }
  404. if (r.adult != null) {
  405. refreshCatalogShow(id)
  406. searchTitleChanged(id)
  407. }
  408. let took = now() - t
  409. if (took > 1500) { console.log('adult backfill: slow step, show ' + id + ', ' + took + ' ms') }
  410. backfillNextAt = now() + r.requests * msPerRequest
  411. let finished = backfillPos >= backfillQueue.length
  412. if (finished || backfillPos % 25 == 0) { persistSync() }
  413. if (!finished && backfillTotals.titles > 0 && backfillTotals.titles % backfillLogEvery == 0 && !r.retry) { console.log('adult backfill: ' + backfillLine()) }
  414. if (finished) {
  415. backfillDone = true
  416. console.log('adult backfill done: ' + backfillLine())
  417. }
  418. return null
  419. }
  420. // ---- THE DETAILS REPAIR (tracker.worldapi.org#26, details.hl completeStep) ----------------------------------------
  421. // Titles the person pages added from a filmography (#16) are MINIMAL (no poster, seasons, ids, cast …). Opening one completes
  422. // it (components/show.hl); this job completes the rest in the background: at start it collects every incomplete, non-adult
  423. // title and does ONE per step on the app's clock, like the adult backfill — a step is the daily sync's work for one title
  424. // (1–3 TMDB requests + poster + TVmaze), requests queued meanwhile are served between two steps; then a pause of 260 ms per
  425. // TMDB request + 550 ms per TVmaze request (pauseMsAfter: ≤ 40 / 10 s, ≤ 20 / 10 s). RESUMES after a restart (the queue is
  426. // what is still incomplete); TMDB 404 marks the title (`detailsCheck`), a passing failure goes to the back of the queue (at
  427. // most 2 more tries per start). Waits while the daily sync or the adult backfill runs. Persisted every 10 titles + at the end.
  428. // Log: start, every TRACKER_REPAIR_LOG_EVERY (100) titles, each failure, done. TRACKER_REPAIR=0 switches it off (off too
  429. // without TMDB_READ_TOKEN). TRACKER_REPAIR_FAST=1 (the gate, fake TMDB only): 20 ms pause instead.
  430. repairOn = env('TRACKER_REPAIR') != '0' && syncEnabled
  431. repairFast = env('TRACKER_REPAIR_FAST') == '1'
  432. repairLogEvery = env('TRACKER_REPAIR_LOG_EVERY') != null ? toNumber(env('TRACKER_REPAIR_LOG_EVERY')) : 100
  433. repairQueue = null
  434. repairPos = 0
  435. repairDone = false
  436. repairAt = 0
  437. repairNextAt = 0
  438. repairTries = {}
  439. repairTotals = { titles = 0 complete = 0 failed = 0 adult = 0 newSeasons = 0 newEpisodes = 0 posters = 0 cast = 0 requests = 0 tvmazeRequests = 0 retries = 0 }
  440. repairLine = () => {
  441. let b = repairTotals
  442. return b.titles + '/' + repairQueue.length + ' titles, complete=' + b.complete + ' failed=' + b.failed + ' adult=' + b.adult + ' newSeasons=' + b.newSeasons + ' newEpisodes=' + b.newEpisodes
  443. + ' posters=' + b.posters + ' cast=' + b.cast + ' requests=' + b.requests + ' tvmazeRequests=' + b.tvmazeRequests + ' retries=' + b.retries + ' seconds=' + ((now() - repairAt) / 1000)
  444. }
  445. repairTick = () => {
  446. if (repairDone) { return null }
  447. let t = now()
  448. if (repairQueue == null) {
  449. repairQueue = detailsRepairQueue()
  450. repairAt = t
  451. console.log('details repair: start, ' + repairQueue.length + ' incomplete titles (' + (now() - t) + ' ms to find them)')
  452. if (repairQueue.length == 0) { repairDone = true console.log('details repair: nothing to do') }
  453. return null
  454. }
  455. if (t < repairNextAt) { return null }
  456. let id = repairQueue[repairPos]
  457. let r = completeStep(id)
  458. let took = now() - t
  459. if (took > 1500) { console.log('details repair: slow step, show ' + id + ', ' + took + ' ms') }
  460. if (r.error != '') { console.log('details repair: ' + r.error) }
  461. repairNextAt = now() + (repairFast ? 20 : pauseMsAfter(r))
  462. // a series takes several steps: the same title again next time
  463. if (!r.done && !r.retry) { return null }
  464. repairPos = repairPos + 1
  465. if (r.retry && (repairTries[id] == null || repairTries[id] < 2)) {
  466. repairTries[id] = repairTries[id] == null ? 1 : repairTries[id] + 1
  467. let q = repairQueue
  468. q.push(id)
  469. repairQueue = q
  470. repairTotals.retries = repairTotals.retries + 1
  471. } else if (!r.skipped) {
  472. // done: its counts (a failed first step: the request alone)
  473. let sum = r.sum
  474. repairTotals.titles = repairTotals.titles + 1
  475. if (r.adult == true) { repairTotals.adult = repairTotals.adult + 1 } else if (sum.steps == 0) { repairTotals.failed = repairTotals.failed + 1 } else { repairTotals.complete = repairTotals.complete + 1 }
  476. repairTotals.newSeasons = repairTotals.newSeasons + sum.newSeasons
  477. repairTotals.newEpisodes = repairTotals.newEpisodes + sum.newEpisodes
  478. repairTotals.posters = repairTotals.posters + sum.posters
  479. repairTotals.cast = repairTotals.cast + sum.cast
  480. repairTotals.requests = repairTotals.requests + (sum.steps == 0 ? r.requests : sum.requests)
  481. repairTotals.tvmazeRequests = repairTotals.tvmazeRequests + sum.tvmazeRequests
  482. }
  483. let finished = repairPos >= repairQueue.length
  484. if (finished || repairPos % 10 == 0) { persistDetails() }
  485. if (!finished && !r.skipped && !r.retry && repairTotals.titles > 0 && repairTotals.titles % repairLogEvery == 0) { console.log('details repair: ' + repairLine()) }
  486. if (finished) {
  487. repairDone = true
  488. console.log('details repair done: ' + repairLine())
  489. }
  490. return null
  491. }
  492. // ---- THE CREDITS JOB (tracker.worldapi.org#28, details.hl creditsStep) ------------------------------------------------------
  493. // Every PUBLIC title (adult == false; adult/unknown are skipped) with a TMDB id gets its whole cast + crew once: at start (after
  494. // the adult backfill and the details repair are done) the job collects every such title without `creditsAt` and asks ONE per
  495. // step on the app's clock — one request (details + credits / aggregate_credits), then 260 ms (≤ 40 / 10 s); requests queued
  496. // meanwhile are served between two steps. Titles the details repair, the daily sync or an import already did carry `creditsAt`
  497. // and are not asked. RESUMES after a restart (the queue = what still has no credits); TMDB 404 / adult → `creditsCheck`, never
  498. // asked again; a passing failure goes to the back of the queue (at most 2 more tries per start). Waits while the daily sync
  499. // runs. Persisted (shows + people only) every 25 titles + at the end. Log: start, every TRACKER_CREDITS_LOG_EVERY (500) titles, failures, slow steps
  500. // (> 1.5 s), done. TRACKER_CREDITS=0 switches it off (off too without TMDB_READ_TOKEN). TRACKER_CREDITS_FAST=1 (the gate, fake
  501. // TMDB only): 20 ms pause instead.
  502. // MEMORY LIMIT: the runtime never frees what a fetch + JSON parse took (mission 061 measured ~6 MB more RSS per title on the real
  503. // data, 300 fetches of a 440 KB JSON = +2.7 GB in a 10-line script) — the whole job in one process would add ~35 GB. Before every
  504. // step the job reads its own RSS (/proc/self/status); above TRACKER_CREDITS_MAX_MB (16000) it PAUSES for this process (logged) and
  505. // goes on with what is left after the next restart (deploy, `docker restart`).
  506. creditsOn = env('TRACKER_CREDITS') != '0' && syncEnabled
  507. creditsFast = env('TRACKER_CREDITS_FAST') == '1'
  508. creditsLogEvery = env('TRACKER_CREDITS_LOG_EVERY') != null ? toNumber(env('TRACKER_CREDITS_LOG_EVERY')) : 500
  509. creditsQueueIds = null
  510. creditsPos = 0
  511. creditsDone = false
  512. creditsAt = 0
  513. creditsNextAt = 0
  514. creditsTries = {}
  515. creditsMaxMb = env('TRACKER_CREDITS_MAX_MB') != null ? toNumber(env('TRACKER_CREDITS_MAX_MB')) : 16000
  516. creditsTotals = { titles = 0 done = 0 failed = 0 cast = 0 crew = 0 people = 0 requests = 0 retries = 0 slowest = 0 }
  517. // this process' resident memory in MB (VmRSS), 0 when unknown
  518. rssMb = () => {
  519. if (!exists('/proc/self/status')) { return 0 }
  520. let t = readFile('/proc/self/status')
  521. let i = t != null ? t.indexOf('VmRSS:') : -1
  522. if (i < 0) { return 0 }
  523. let kb = toNumber(t.slice(i + 6, t.indexOf('kB', i)).trim())
  524. return kb != null ? (kb - kb % 1024) / 1024 : 0
  525. }
  526. creditsLine = () => {
  527. let b = creditsTotals
  528. return b.titles + '/' + creditsQueueIds.length + ' titles, done=' + b.done + ' failed=' + b.failed + ' cast=' + b.cast + ' crew=' + b.crew + ' people=' + b.people
  529. + ' requests=' + b.requests + ' retries=' + b.retries + ' slowestStepMs=' + b.slowest + ' seconds=' + ((now() - creditsAt) / 1000)
  530. }
  531. creditsTick = () => {
  532. if (creditsDone) { return null }
  533. let t = now()
  534. if (creditsQueueIds == null) {
  535. creditsQueueIds = creditsQueue()
  536. creditsAt = t
  537. console.log('credits job: start, ' + creditsQueueIds.length + ' titles without credits (' + (now() - t) + ' ms to find them)')
  538. if (creditsQueueIds.length == 0) { creditsDone = true console.log('credits job: nothing to do') }
  539. return null
  540. }
  541. if (t < creditsNextAt) { return null }
  542. let mb = rssMb()
  543. if (mb > creditsMaxMb) {
  544. creditsDone = true
  545. persistCredits()
  546. console.log('credits job: paused, RSS ' + mb + ' MB > TRACKER_CREDITS_MAX_MB ' + creditsMaxMb + ' — ' + (creditsQueueIds.length - creditsPos) + ' titles left for the next start; ' + creditsLine())
  547. return null
  548. }
  549. let id = creditsQueueIds[creditsPos]
  550. creditsPos = creditsPos + 1
  551. let r = creditsStep(id)
  552. let took = now() - t
  553. if (took > creditsTotals.slowest) { creditsTotals.slowest = took }
  554. if (took > 1500) { console.log('credits job: slow step, show ' + id + ', ' + took + ' ms, cast=' + r.cast + ' crew=' + r.crew + ' people=' + r.people) }
  555. if (r.error != '') { console.log('credits job: ' + r.error) }
  556. creditsNextAt = now() + (creditsFast ? 20 : r.requests * msPerRequest)
  557. if (r.retry && (creditsTries[id] == null || creditsTries[id] < 2)) {
  558. creditsTries[id] = creditsTries[id] == null ? 1 : creditsTries[id] + 1
  559. let q = creditsQueueIds
  560. q.push(id)
  561. creditsQueueIds = q
  562. creditsTotals.retries = creditsTotals.retries + 1
  563. } else if (!r.skipped) {
  564. creditsTotals.titles = creditsTotals.titles + 1
  565. if (r.error != '') { creditsTotals.failed = creditsTotals.failed + 1 } else { creditsTotals.done = creditsTotals.done + 1 }
  566. creditsTotals.cast = creditsTotals.cast + r.cast
  567. creditsTotals.crew = creditsTotals.crew + r.crew
  568. creditsTotals.people = creditsTotals.people + r.people
  569. }
  570. creditsTotals.requests = creditsTotals.requests + r.requests
  571. let finished = creditsPos >= creditsQueueIds.length
  572. if (finished || creditsPos % 25 == 0) { persistCredits() }
  573. if (!finished && !r.skipped && !r.retry && creditsTotals.titles > 0 && creditsTotals.titles % creditsLogEvery == 0) { console.log('credits job: ' + creditsLine()) }
  574. if (finished) {
  575. creditsDone = true
  576. console.log('credits job done: ' + creditsLine())
  577. }
  578. return null
  579. }
  580. // ONE clock for all four (a tick every 0.1 s): the daily sync's step once a second as before; the backfill's steps in
  581. // between, only while no daily run is going on; the details repair only when neither has work; the credits job (#28) last
  582. clockOn = syncOn || backfillOn || repairOn || creditsOn
  583. clockTicks = 0
  584. if (syncOn) { console.log('tmdb sync: daily at ' + syncHour + ':00 UTC') } else { console.log('tmdb sync: off (' + (syncEnabled ? 'TRACKER_SYNC=0' : 'no TMDB_READ_TOKEN') + ')') }
  585. if (!backfillOn) { console.log('adult backfill: off (' + (syncEnabled ? 'TRACKER_BACKFILL=0' : 'no TMDB_READ_TOKEN') + ')') }
  586. if (!repairOn) { console.log('details repair: off (' + (syncEnabled ? 'TRACKER_REPAIR=0' : 'no TMDB_READ_TOKEN') + ')') }
  587. if (!creditsOn) { console.log('credits job: off (' + (syncEnabled ? 'TRACKER_CREDITS=0' : 'no TMDB_READ_TOKEN') + ')') }
  588. if (clockOn) {
  589. syncClock = every(0.1)
  590. on syncClock.tick(x) {
  591. clockTicks = clockTicks + 1
  592. let busy = syncQueue.length > 0 || syncPlanning
  593. if (syncOn && clockTicks % 10 == 0) { syncTick() }
  594. let free = !busy && syncQueue.length == 0 && !syncPlanning
  595. if (backfillOn && free && !backfillDone) { backfillTick() }
  596. else if (repairOn && free && (!backfillOn || backfillDone) && !repairDone) { repairTick() }
  597. else if (creditsOn && free && (!backfillOn || backfillDone) && (!repairOn || repairDone)) { creditsTick() }
  598. return null
  599. }
  600. }
  601. // ---- THE SHORT-ID BACKFILL (mission 060, tracker.worldapi.org#27, shortids.hl shortIdStep) ----------------------------
  602. // Every show and person without a short id gets one in the background: on its own clock (every 0.1 s) ONE batch per tick,
  603. // as many records as fit into TRACKER_SHORTID_BUDGET_MS (default 40 ms) — no TMDB, only the tables — so a page waits at
  604. // most one batch. The queue is built at start (`ensureShortIds`) from what is still missing = it resumes after a restart.
  605. // Persisted every 20 batches and at the end. Log: start, every TRACKER_SHORTID_LOG_EVERY (5000) records, done; with nothing
  606. // to do one line. TRACKER_SHORTIDS=0 switches it off (the gate's resume check).
  607. shortIdOn = env('TRACKER_SHORTIDS') != '0'
  608. shortIdBudget = env('TRACKER_SHORTID_BUDGET_MS') != null ? toNumber(env('TRACKER_SHORTID_BUDGET_MS')) : 40
  609. shortIdLogEvery = env('TRACKER_SHORTID_LOG_EVERY') != null ? toNumber(env('TRACKER_SHORTID_LOG_EVERY')) : 5000
  610. shortIdRun = { at = 0 batches = 0 assigned = 0 nextLog = 0 slowest = 0 slowestPersist = 0 done = false }
  611. shortIdTick = () => {
  612. if (shortIdRun.done) { return null }
  613. let t = now()
  614. let r = shortIdStep(shortIdBudget)
  615. let took = now() - t
  616. shortIdRun.batches = shortIdRun.batches + 1
  617. shortIdRun.assigned = shortIdRun.assigned + r.assigned
  618. if (took > shortIdRun.slowest) { shortIdRun.slowest = took }
  619. if (r.done || shortIdRun.batches % 20 == 0) {
  620. let tp = now()
  621. persistShortIds()
  622. if (now() - tp > shortIdRun.slowestPersist) { shortIdRun.slowestPersist = now() - tp }
  623. }
  624. if (!r.done && shortIdRun.assigned >= shortIdRun.nextLog) {
  625. console.log('short ids: ' + shortIdRun.assigned + ' assigned, ' + r.left + ' left, ' + ((now() - shortIdRun.at) / 1000) + ' s')
  626. shortIdRun.nextLog = shortIdRun.nextLog + shortIdLogEvery
  627. }
  628. if (r.done) {
  629. shortIdRun.done = true
  630. let s = shortIdStats()
  631. console.log('short ids done: assigned=' + shortIdRun.assigned + ' oldKept=' + s.oldKept + ' batches=' + shortIdRun.batches + ' slowestBatchMs=' + shortIdRun.slowest + ' slowestPersistMs=' + shortIdRun.slowestPersist + ' seconds=' + ((now() - shortIdRun.at) / 1000))
  632. }
  633. return null
  634. }
  635. if (!shortIdOn) { console.log('short ids: backfill off (TRACKER_SHORTIDS=0), ' + shortIdsLeft() + ' records without one') }
  636. else if (shortIdsLeft() == 0) { console.log('short ids: nothing to do') }
  637. else {
  638. shortIdRun.at = now()
  639. shortIdRun.nextLog = shortIdLogEvery
  640. console.log('short ids: backfill start, ' + shortIdsLeft() + ' records, ' + shortIdBudget + ' ms per batch')
  641. shortIdClock = every(0.1)
  642. on shortIdClock.tick(x) {
  643. shortIdTick()
  644. return null
  645. }
  646. }
  647. on Error(e) { console.log('error absorbed: ' + e.message) }

Branches

Latest commits

  • 20e09d89Merge t18 (tracker#18 delta sync) into main (mission 070): conflicts README/STATUS/show.hl/project.hl/browser.mjs, both sides kept; pageShowOf summary = summaryOfmre
  • f83571c3tracker#18 (mission 067): daily sync by change lists — TMDB /tv|movie/changes (since the stored day, paged) + TVmaze /updates/shows → only our changed titles (followed: full step, unfollowed: light step — changed seasons, no TVmaze), full walk on first run / gap > 14 days / failed list; show record refreshed (title, tmdbSummary, tagline, status, genres …; renamed titles re-indexed); summary = the creator's own text (page: summary > tmdbSummary > tvmazeSummary), one-time clear of copied summaries (9,647 on the live copy); gate 261, tests/realdata-018*.mjs, README + STATUSmre
  • f2b00674Merge t26 (tracker#26 + #28) into main (mission 062): short ids for every new person (castPersonId, guest route), guest stars stored on the title and created as people only when opened (/person/tmdb/<id>?show=<id> → 302), lean watch/follow clicks (showRow a small object, cast/crew from the slug, watches cached per user, face rows only after a season toggle); gate 311, tests/realdata-062.mjs, README + STATUSmre
  • fa1f9dfatracker#29 (mission 063): unwatched check muted grey outline + check (accent only on hover), watched stays solid — no code regression, the accent outline read as ticked; gate checks real checks visibly (computed style + screenshot pixel) on /my/unwatched, show, movie, /my/movies; gate 266, tests/realdata-063.mjs, README + STATUSmre
  • 10bb3f93tracker#28 (mission 061): full cast (all seasons, main cast by episodes, guest stars) + crew (created by, directed by, written by, screenplay, story, music) — stored by the details completion, the daily sync, the search import (one details request) and a background credits job (resumes, RSS limit); show page collapsed after 20 with client-side Show all; showBySlug via a slug map; gate 249, tests/realdata-028.mjs, README + STATUSmre
  • d8b12d67tracker#27 (mission 060): short ids for movies, series and persons — old 702 kept (data/old-short-ids.json), new random [a-z0-9]{5} unique across both, claimed at creation, background backfill (resumes), shown under poster/photo, /<shortId> → 301; gate 259, tests/realdata-060*, README + STATUSmre
  • 25a50bc4tracker#26 (mission 059): titles from a filmography are completed — on open (skeleton, step-wise face showComplete, no reload) and by the in-app details repair (resumes, TMDB-paced, series in parts); cast from TMDB credits; gate 231, tests/realdata-026.mjs, README + STATUSmre
  • f14db671tracker#22-#25 (mission 058): episode air dates, season check = all episodes watched, movie watched check (+ /my/movies count), /genres/<genre> pages (movies + series, newest first, paginated); gate 238, tests/realdata-058.mjs, README + STATUSmre
  • 1704ec45tracker#17 (mission 057): season caret down/up, skeleton rows while a season loads, sessionless showSeasonEpisodes face (no page re-mount), client-only close; gate 214, tests/realdata-057.mjs, README + STATUSmre
  • f2fe3e36mission 056: README + STATUS (merge, fixes, Hybriel 8590df63, real-data check), tests/realdata-056.mjs, tools/check-public-slugs.hlmre
  • f40c250emission 056: re-vendor hybriel master 8590df63 (#121, #122); an adult title's page is Not found for non-followers; gate: leave the page before stopping the servermre
  • 2b7fdd6cmission 056: signed-out header one row on phones ("Log in", nowrap), backfill skips adult titles' posters, gate checksmre
  • 2c53d5efMerge branch 't16-person' (tracker#16 person pages) into main; filmography shows only public titles (054 adult flag), gate race fix (backfill start line)mre
  • c171227emission 054: hide adult/unknown titles from the public lists and the search; in-app adult-flag backfill (TMDB details + poster per title, resumes), gate + real-data proofmre
  • 139fafd8tracker#16: short bio (4 lines, click = all), real-data check script, README + STATUSmre
  • 93be9476tracker#16: person pages /person/<slug> with the filmography fetched from TMDB on the first visit (step by step), gatemre
  • 47a3cae6STATUS: mission 053 merge commit idsmre
  • dcc5eecaMerge branch 't14-search'mre
  • 03edc783Merge branch 't15-tvmaze'mre
  • 71b46345tracker#15: numbering check by date or title, placeholder titles in other languages, docs + real-data proofmre