gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3da2ea863da2ea86RV48: report day48 cold starts, gates and cleanupmre3da2ea86/components/myshows.hl

3.6 KB

  1. // components/myshows.hl — `/my/shows` (tracker.worldapi.org#7): every show the signed-in user follows,
  2. // the one followed last on top. Creator's words: "trackers /my/shows that just ists the shows in desc
  3. // order i followed them, small poster, title, last episode like s08e35". Each row: the small poster (the
  4. // same `/posters/<name>` route + placeholder as the show page, shows.hl `posterUrlOf`: one `/posters/none` URL when the file is missing), the title linking
  5. // to `/shows/<slug>`, and the LAST WATCHED episode as `S08E35` — the architect's reading (in the ticket):
  6. // the highest season/episode number the user has watched of that show; nothing watched → no episode.
  7. //
  8. // Read-only page (no check icons, no click), so like /schedule it needs no `on server` face — `rows` is
  9. // one server-side render from `session`. Since #13 SERIES only — the movies a user follows are /my/movies
  10. // (components/mymovies.hl). Reused (not copied): `followsOfUser`, `insertByFollowDesc` (follows.hl),
  11. // `watchesOfUser` (watches.hl), `cardOf`/`episodeKeyOf`/`posterUrlOfName`/`episodeCode` (shows.hl).
  12. //
  13. // COST (tracker#30, mission 025): no record is read per load — each followed title's slim cached card (shows.hl cardOf) and
  14. // each watched episode's cached { show s e } (episodeKeyOf; the user's watches are kept, watches.hl). Before, one fetch per
  15. // followed title (cast + crew) and one per watched episode (11.7k) — 4.4 s on a process after the first-start jobs.
  16. //
  17. // tracker.worldapi.org#21 (mission 068): TWO lists from this one component — `/my/series` (the followed SERIES) and `/my/shows`
  18. // (the followed SHOWS: reality, talk, news; shows.hl titleKind) — routed as `/my/:tv` (project.hl, after the other /my/ routes);
  19. // any other word is "Not found". Each row links to the title's own page (shows.hl titlePath).
  20. parent './main.hl'
  21. import { appTitle } from '../lib/app.hl'
  22. import { userIdOfSession } from '../lib/users.hl'
  23. import { listKindOf, myShowsRowsOf } from '../lib/follows.hl'
  24. // ---- reactive members -----------------------------------------------------------------------
  25. tv = null
  26. listKind = listKindOf(&tv)
  27. found = listKind != null
  28. notFound = listKind == null
  29. isSeries = listKind == 'series'
  30. listWord = isSeries ? 'Series' : 'Shows'
  31. listClass = isSeries ? 'type-word type-series' : 'type-word type-show'
  32. session = null
  33. userId = userIdOfSession(&session)
  34. signedIn = userId != null
  35. // a plain copy of userId for `rows` (mission 047: session sync, see components/show.hl `me`)
  36. me = userId
  37. rows = signedIn ? myShowsRowsOf(&me, &listKind) : []
  38. hasRows = rows.length > 0
  39. noRows = found && !hasRows
  40. emptyText = signedIn ? (isSeries ? 'You follow no series yet.' : 'You follow no shows yet.') : (isSeries ? 'Sign in to see the series you follow.' : 'Sign in to see the shows you follow.')
  41. __title = found ? 'My ' + listWord.toLowerCase() + ' — ' + appTitle : appTitle
  42. // Component styles use the shared theme variables.
  43. Style {
  44. myShowsPage {
  45. display = 'block'
  46. }
  47. myShowEpisode {
  48. flex = 'none'
  49. fontSize = '.9rem'
  50. color = 'var(--color-text-muted)'
  51. fontVariantNumeric = 'tabular-nums'
  52. }
  53. }
  54. View {
  55. myShowsPage { "data-kind" = listKind
  56. if (notFound) {
  57. h1 { "Not found" }
  58. p { "This list doesn't exist." }
  59. }
  60. // tracker.worldapi.org#20: "My" and the list's type word in its colour
  61. if (found) { h1 { class = "typed" "My" typeWord { class = listClass listWord } } }
  62. if (noRows) { p { class = "muted" emptyText } }
  63. if (hasRows) {
  64. myShowsRows {
  65. for (row of rows) {
  66. myShowRow {
  67. img { class = "myshow-poster" src = row.posterUrl alt = row.title }
  68. a { class = "myshow-title" href = row.href row.title }
  69. if (row.hasEpisode) { myShowEpisode { row.episodeLabel } }
  70. }
  71. }
  72. }
  73. }
  74. }
  75. }

Branches

Latest commits

  • 3da2ea86RV48: report day48 cold starts, gates and cleanupmre
  • 8d9ecdfeRV48: re-vendor Hybriel set day48 (source b6a8f429, bin 660a9524)mre
  • 4a802ae7status: RV48 runningmre
  • 0a5412b6RV48 brief, day48 outmre
  • 56665efelog: CB69 mergedmre
  • 05448a98Merge cb69-imports: appTitle in a dependency-free topicmre
  • e55b379dKeep shared app title independent of the route import graphmre
  • 9a99659blog: hybriel#334, batch waits for day48mre
  • 85fa6c9blog: CB68 result, CB69 startedmre
  • 2f07c1b7log: DP68 boot gate failed, CB68mre
  • 9652782dlog: HM59 merged, DP68 startedmre
  • 29867a75Merge hm59-logic: tracker#59 page logic moved to libmre
  • f7bfe90bMove remaining page builders into their topicsmre
  • 7c3991f9log: day46 from Antonmre
  • ec54fc35Move show page logic into the shows topicmre
  • c1a8d074log: correct timesmre
  • 5827eba9log: HM57 merged, HM59 startedmre
  • d1a91be9Merge hm57-let: tracker#57 let only for reassigned namesmre
  • a404ed75Report HM57 audit, gates and integration notesmre
  • 1dcb87a7Use plain declarations for unchanged bindingsmre