gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit85cfb4ae85cfb4ae|||PR records: AP61 day61, DP74 liveTracker85cfb4ae/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

  • 85cfb4ae|||PR records: AP61 day61, DP74 liveTracker
  • b1496147Merge branch 'ap61' into mainTracker
  • 2047955bMerge branch 'u12-gateports' into mainTracker
  • c8da40f3|||PR AP61: re-vendor Hybriel set day61 (source a05af47c, bin a11042e5)Tracker
  • 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
  • 0b86324aMerge branch 'records-dp73' into mainTracker
  • 9ce5f59b|||PR records: DP73 live 613ae0e; deploy.sh keeps 2 backupsTracker
  • 613ae0ecMerge branch 'bs3' into mainTracker
  • 1383264b|||PR BS3: keep shared synchronous sorting fastTracker
  • 63e5ba1a|||PR BS3: guard boot imports and share resumable sort buffersTracker
  • 310613f1Merge branch 'records-dp72' into mainTracker
  • 6f7b61ba|||PR records: deploy-swap fix live, Kunibert findingsTracker
  • c41587d2Merge branch 'bs2' into mainTracker
  • 0dd538a6|||PR BS2: finish the boot index in slices so a booting instance keeps answeringTracker
  • 019d5cedMerge branch 'records-1110' into mainTracker
  • f88ae8b9|||PR records: day56 toggle live, reviewTracker
  • b6b3bb4dMerge branch 'ap56e' into mainTracker
  • 29a26da9|||PR AP56e: guard hidden show helpers during session syncTracker
  • 7c9ec236|||PR AP56e: re-vendor Hybriel set day56 (source 36ae83a8, bin c1f595a2)Tracker
  • 4b54f6f9Merge branch 'records-audit' into mainTracker