tracker
All repositories: gitoria
3.3 KB
// components/schedule.hl — `/my/schedule` (tracker.worldapi.org#6, moved from `/schedule` in #8): every episode of a show the signed-in// user follows that is not yet released, soonest first. Creator's words: "/schedule has a similar list// without check icons for he upcoming episodes of shows followed". Same row shape as /unwatched (step 5)// minus the check icon and minus any click handling — this page is read-only, so it needs no `on server`// face at all. Reused (not copied) from follows.hl/shows.hl: `followedShowIds`, `showById`,// `seasonsOfShow`, `episodesOfSeason` — the same functions /unwatched already imports.//// Upcoming = release date strictly AFTER today (the architect's reading of the ticket: "the creator named// the order only for /unwatched" — /unwatched is release <= today, so the natural complement here is// release > today; an episode releasing today already belongs to /unwatched once watched state is added).parent './main.hl'import { appTitle } from '../project.hl'import { userIdOfSession } from '../users.hl'import { followedShowIds } from '../follows.hl'import { showById, seasonsOfShow, episodesOfSeason, episodeCode, titleWithYear } from '../shows.hl'import { now, timestamp } from 'hl:time'// ---- pure helpers (static: an mpackdb-backed helper must be `static` to stay callable outside its// own initializer, hybriel#115/#116 — see components/unwatched.hl's header comment) --------------static todayStr = () => { return timestamp(now()).slice(0, 10) }// insertion sort, hand-written (no list sort(), hybriel#1) — soonest release firststatic insertByReleaseAsc = (sorted, row) => {let out = []let inserted = falsefor (x of sorted) {if (!inserted && row.release <= x.release) { out.push(row) inserted = true }out.push(x)}if (!inserted) { out.push(row) }return out}static scheduleRowsOf = (userId) => {if (userId == null) { return [] }let today = todayStr()let out = []for (sid of followedShowIds(userId)) {let show = showById(sid)if (show != null) {for (s of seasonsOfShow(show)) {for (e of episodesOfSeason(s)) {let upcoming = e.release != null && e.release > todayif (upcoming) {let title = e.title != null ? e.title : ''out = insertByReleaseAsc(out, {id = e.id showTitle = titleWithYear(show) showHref = '/shows/' + show.urlSegmentepisodeLabel = episodeCode(e.seasonNumber, e.episodeNumber) + ' · ' + titlerelease = e.release})}}}}}return out}// ---- reactive members -----------------------------------------------------------------------session = nulluserId = userIdOfSession(session)signedIn = userId != null// a plain copy of userId for `rows` (mission 047: session sync, see components/show.hl `me`)me = userIdrows = signedIn ? scheduleRowsOf(me) : []hasRows = rows.length > 0noRows = !hasRowsemptyText = signedIn ? 'No upcoming episodes.' : 'Sign in to see the shows you follow.'__title = 'Schedule — ' + appTitleView {schedulePage {h1 { "Schedule" }if (noRows) { p { class = "muted" emptyText } }if (hasRows) {scheduleRows {for (row of rows) {scheduleRow {a { class = "schedule-show" href = row.showHref row.showTitle }scheduleEpisode { row.episodeLabel }scheduleDate { row.release }}}}}}}
Branches
- mainmain branch
Latest commits
- 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
- 6bb2daf1tracker#13: homepage (tiles, intro, latest movies/shows), /shows, /movies/page/N, /my/movies; lists cached in memorymre
- b8bd1157tracker#14: README + STATUS (search, real-data numbers, gate, merge notes)mre