@soffits/dsh-media-hub 0.11.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/dist/index.js +46 -35
- package/locale/en.json +1 -3
- package/locale/fr.json +1 -3
- package/locale/zh.json +1 -3
- package/package.json +1 -1
- package/web/books-view.js +20 -19
- package/web/feed-view.js +32 -24
- package/web/library-card.js +42 -0
- package/web/library-view.js +27 -29
- package/web/panel.css +7 -13
- package/web/presence-view.js +6 -33
- package/web/watching-view.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
- The recommender's picks moved from Discover to the Watching tab, under what you are watching, as *For you* (still switched by `presence.picks`). Each is the card of its kind (watch it, or download a book) under the reason it was picked. Discover keeps each source's trending lists and search.
|
|
6
|
+
- Fanqie's audiobooks no longer declare trending: the app's listening tab holds no audiobook works to list.
|
|
7
|
+
- The recommender protocol changed: `recommend` no longer takes `--source` and `--kind`; the hub passes the trending lists it already holds as candidates on stdin (`{ "candidates": [...] }`), so one run a day serves every category and the sources are asked nothing twice. Picks are kept as one dated copy per person and language and made in the background.
|
|
8
|
+
|
|
9
|
+
## 0.12.0
|
|
10
|
+
|
|
11
|
+
- A show and a book look the same in the Library. Every item is one card: the same cover slot, a title with its type, one line of facts (a show's rating, status and progress; a book's author, format and size), tags, and the actions in the same place, with Delete under the … menu for books as it is for shows.
|
|
12
|
+
|
|
3
13
|
## 0.11.1
|
|
4
14
|
|
|
5
15
|
- The page's words come from the language files each time it asks, not from a copy made when the plugin started. An update that only changed words (0.11.0's type badges) showed raw keys until DSH restarted.
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ The bundle adds two rows: `media-hub` (the page, shelves, rooms, media) and `med
|
|
|
30
30
|
|
|
31
31
|
## Use
|
|
32
32
|
|
|
33
|
-
- **From the page**: open **Media** in the sidebar (the `label` setting renames it). Three tabs: **Watching** (the default) lists the rooms opened to others, with who is in them and the episode, with copying a room's link or closing it, and the shows someone started, to continue; **Library** manages the shows and starts or continues one; **Discover** searches: pick a source (*All sources*, every configured one, or *Link* to paste the address of a video or playlist), then one of that source's categories, then search. Before any search it shows what the sources put forward for that category (their rank lists and new arrivals, from a source's `trending` verb)
|
|
33
|
+
- **From the page**: open **Media** in the sidebar (the `label` setting renames it). Three tabs: **Watching** (the default) lists the rooms opened to others, with who is in them and the episode, with copying a room's link or closing it, and the shows someone started, to continue; **Library** manages the shows and starts or continues one; **Discover** searches: pick a source (*All sources*, every configured one, or *Link* to paste the address of a video or playlist), then one of that source's categories, then search. Before any search it shows what the sources put forward for that category (their rank lists and new arrivals, from a source's `trending` verb) (Link has none). They are kept as dated copies and refreshed in the background about daily, so the page never waits on a site; *All sources* lists each source's boards under its name. Picks from a `recommender` show on the Watching tab. The tab, source and category are in the page's URL (`?vs-tab=library`, `?vs-tab=discover&vs-source=<id>&vs-kind=<id>`), so a refresh and the back button keep them and a link can open a tab directly; the last source and category are remembered per browser.
|
|
34
34
|
- **Watching**: a card at the top for the show someone is in now, or the one you watched last, over its blurred cover: who is in the room, where it stands, a strip of its episodes (watched, now, on disk), and joining them, or continuing alone, or *Watch together* to open it to others. Optional parts, each off until switched on in `presence`: *So far*, a recap without spoilers kept with the show; *How was it?*, one tap that writes a rating into the watch log for a show finished or removed lately; and *Picks*, works a recommender extension suggests, each with its reason. Steps suggested for a show (written through the tool's `annotate`) show on the card when [@soffits/dsh-ui-actions](https://github.com/soffits/dsh-ui-actions) is installed.
|
|
35
35
|
- **From the assistant**: `videosync` with `action: start` and `source: local` plus `path`, `source: link` plus `url` (and `quality`), or `source: <source id>` plus `id` (and `offline: true` to keep every episode), returns a link to send. `list` and `close` manage rooms, `library` lists the shows, `history` summarises the watch log (shows, episodes finished, where each viewer stopped, with whom, when).
|
|
36
36
|
|
package/dist/index.js
CHANGED
|
@@ -10647,10 +10647,15 @@ async function commandExists(command, path = process.env.PATH ?? "") {
|
|
|
10647
10647
|
}
|
|
10648
10648
|
return false;
|
|
10649
10649
|
}
|
|
10650
|
-
function run(argv, { signal, timeoutMs, onStdoutLine, cwd, env } = {}) {
|
|
10650
|
+
function run(argv, { signal, timeoutMs, onStdoutLine, cwd, env, input } = {}) {
|
|
10651
10651
|
return new Promise((resolve7, reject) => {
|
|
10652
10652
|
const [command, ...args] = argv;
|
|
10653
|
-
const child = spawn(command, args, { stdio: ["ignore", "pipe", "pipe"], detached: true, cwd, env: { ...process.env, ...env } });
|
|
10653
|
+
const child = spawn(command, args, { stdio: [input === void 0 ? "ignore" : "pipe", "pipe", "pipe"], detached: true, cwd, env: { ...process.env, ...env } });
|
|
10654
|
+
if (input !== void 0) {
|
|
10655
|
+
child.stdin.on("error", () => {
|
|
10656
|
+
});
|
|
10657
|
+
child.stdin.end(input);
|
|
10658
|
+
}
|
|
10654
10659
|
let stdout = "";
|
|
10655
10660
|
let stderr = "";
|
|
10656
10661
|
let pending = "";
|
|
@@ -11995,7 +12000,7 @@ var CookieRule = Schema.object({
|
|
|
11995
12000
|
var DEFAULT_SOURCES = Object.freeze([
|
|
11996
12001
|
{
|
|
11997
12002
|
id: "fanqie",
|
|
11998
|
-
kinds: [{ id: "drama", media: "video", trending: true }, { id: "audio", media: "audio"
|
|
12003
|
+
kinds: [{ id: "drama", media: "video", trending: true }, { id: "audio", media: "audio" }, { id: "novel", media: "book", trending: true }],
|
|
11999
12004
|
filters: [],
|
|
12000
12005
|
command: ["fanqie"],
|
|
12001
12006
|
env: {}
|
|
@@ -13976,7 +13981,7 @@ var MAX_STEPS = 3;
|
|
|
13976
13981
|
var STEP_ID = /^[a-z0-9][a-z0-9_-]{0,31}$/;
|
|
13977
13982
|
var MAX_LABEL_CHARS = 120;
|
|
13978
13983
|
var MAX_PROMPT_CHARS = 2e3;
|
|
13979
|
-
var PICKS_LIMIT =
|
|
13984
|
+
var PICKS_LIMIT = 8;
|
|
13980
13985
|
var PICKS_TIMEOUT_MS = 6e4;
|
|
13981
13986
|
var MAX_WHY_CHARS = 280;
|
|
13982
13987
|
var badInput = (message) => Object.assign(new Error(message), { code: "invalid_arguments" });
|
|
@@ -14050,19 +14055,9 @@ function parsePicks(document2, hasSource, limit = PICKS_LIMIT) {
|
|
|
14050
14055
|
}
|
|
14051
14056
|
return out;
|
|
14052
14057
|
}
|
|
14053
|
-
async function recommend({ command, env = {}, cwd, hasSource }, { person,
|
|
14054
|
-
const argv = [
|
|
14055
|
-
|
|
14056
|
-
"recommend",
|
|
14057
|
-
"--json",
|
|
14058
|
-
"--limit",
|
|
14059
|
-
String(limit),
|
|
14060
|
-
...person.id ? ["--person", person.id] : [],
|
|
14061
|
-
...source ? ["--source", source] : [],
|
|
14062
|
-
...kind ? ["--kind", kind] : [],
|
|
14063
|
-
...language ? ["--language", language] : []
|
|
14064
|
-
];
|
|
14065
|
-
const result = await run(argv, { timeoutMs: PICKS_TIMEOUT_MS, cwd, env });
|
|
14058
|
+
async function recommend({ command, env = {}, cwd, hasSource }, { person, language, limit = PICKS_LIMIT, candidates = [] }) {
|
|
14059
|
+
const argv = [...command, "recommend", "--json", "--limit", String(limit), ...person.id ? ["--person", person.id] : [], ...language ? ["--language", language] : []];
|
|
14060
|
+
const result = await run(argv, { timeoutMs: PICKS_TIMEOUT_MS, cwd, env, input: JSON.stringify({ candidates }) });
|
|
14066
14061
|
if (result.code !== 0) throw new Error(`exit ${result.code}: ${result.stderr.trim().split("\n").pop() ?? ""}`);
|
|
14067
14062
|
return parsePicks(JSON.parse(result.stdout), hasSource, limit);
|
|
14068
14063
|
}
|
|
@@ -14778,9 +14773,9 @@ import { mkdir as mkdir10, readFile as readFile11, rename as rename8, writeFile
|
|
|
14778
14773
|
import { dirname as dirname6 } from "node:path";
|
|
14779
14774
|
var DAY_MS3 = 864e5;
|
|
14780
14775
|
var HOUR_MS = 36e5;
|
|
14781
|
-
function createCopies({ file, changed, logger, maxAgeMs = DAY_MS3, retryMs = HOUR_MS, parallel =
|
|
14776
|
+
function createCopies({ file, changed, logger, maxAgeMs = DAY_MS3, retryMs = HOUR_MS, parallel = 4, now = Date.now }) {
|
|
14782
14777
|
const copies = /* @__PURE__ */ new Map();
|
|
14783
|
-
const flying = /* @__PURE__ */ new
|
|
14778
|
+
const flying = /* @__PURE__ */ new Map();
|
|
14784
14779
|
const failedAt = /* @__PURE__ */ new Map();
|
|
14785
14780
|
const waiting = [];
|
|
14786
14781
|
let running = 0;
|
|
@@ -14808,7 +14803,10 @@ function createCopies({ file, changed, logger, maxAgeMs = DAY_MS3, retryMs = HOU
|
|
|
14808
14803
|
}
|
|
14809
14804
|
}
|
|
14810
14805
|
function ask(key, produce) {
|
|
14811
|
-
|
|
14806
|
+
let settled;
|
|
14807
|
+
flying.set(key, new Promise((resolve7) => {
|
|
14808
|
+
settled = resolve7;
|
|
14809
|
+
}));
|
|
14812
14810
|
waiting.push(async () => {
|
|
14813
14811
|
try {
|
|
14814
14812
|
copies.set(key, { at: now(), value: await produce() });
|
|
@@ -14821,11 +14819,23 @@ function createCopies({ file, changed, logger, maxAgeMs = DAY_MS3, retryMs = HOU
|
|
|
14821
14819
|
changed();
|
|
14822
14820
|
} finally {
|
|
14823
14821
|
flying.delete(key);
|
|
14822
|
+
settled();
|
|
14824
14823
|
}
|
|
14825
14824
|
});
|
|
14826
14825
|
pump();
|
|
14827
14826
|
}
|
|
14828
14827
|
return {
|
|
14828
|
+
/**
|
|
14829
|
+
* Like `get`, but a missing copy is waited for (the first ask), for what another copy is made from; an old one still answers at once.
|
|
14830
|
+
* @param {string} key
|
|
14831
|
+
* @param {() => Promise<unknown>} produce
|
|
14832
|
+
*/
|
|
14833
|
+
async ensure(key, produce) {
|
|
14834
|
+
const first = await this.get(key, produce);
|
|
14835
|
+
if (first.value !== null || !flying.has(key)) return first;
|
|
14836
|
+
await flying.get(key);
|
|
14837
|
+
return this.get(key, produce);
|
|
14838
|
+
},
|
|
14829
14839
|
/**
|
|
14830
14840
|
* @param {string} key
|
|
14831
14841
|
* @param {() => Promise<unknown>} produce - the outside answer, asked only when the copy is missing or old
|
|
@@ -14842,7 +14852,6 @@ function createCopies({ file, changed, logger, maxAgeMs = DAY_MS3, retryMs = HOU
|
|
|
14842
14852
|
}
|
|
14843
14853
|
|
|
14844
14854
|
// src/discover.js
|
|
14845
|
-
var DISCOVER_PICKS = 12;
|
|
14846
14855
|
var notFound = (message) => Object.assign(new Error(message), { code: "not_found" });
|
|
14847
14856
|
function createDiscover({ copies, sources, covers, recommender }) {
|
|
14848
14857
|
async function sourcesFor(sourceId, kind, ability) {
|
|
@@ -14875,22 +14884,24 @@ function createDiscover({ copies, sources, covers, recommender }) {
|
|
|
14875
14884
|
};
|
|
14876
14885
|
},
|
|
14877
14886
|
/**
|
|
14878
|
-
* A person's picks
|
|
14887
|
+
* A person's picks (the Watching tab). The recommender is given what every source's trending copy holds, so one
|
|
14888
|
+
* run a day serves all categories and asks the sources nothing more.
|
|
14879
14889
|
* @returns {Promise<{ picks: object[], loading: boolean }>}
|
|
14880
14890
|
*/
|
|
14881
|
-
async picks(person, {
|
|
14891
|
+
async picks(person, { language = "" } = {}) {
|
|
14882
14892
|
if (recommender.command.length === 0) return { picks: [], loading: false };
|
|
14883
|
-
const
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
};
|
|
14893
|
+
const copy = await copies.get(`picks|${person.key}|${language}`, async () => {
|
|
14894
|
+
const candidates = [];
|
|
14895
|
+
for (const one of sources.values()) {
|
|
14896
|
+
if (typeof one.trending !== "function" || !await one.available()) continue;
|
|
14897
|
+
for (const entry of one.kinds.filter((kind) => kind.trending === true)) {
|
|
14898
|
+
const trending = await copies.ensure(`trending|${one.id}|${entry.id}`, () => one.trending(entry.id));
|
|
14899
|
+
if (trending.value !== null) candidates.push({ source: one.id, kind: entry.id, lists: trending.value });
|
|
14900
|
+
}
|
|
14901
|
+
}
|
|
14902
|
+
return recommend(recommender, { person, language, candidates });
|
|
14903
|
+
});
|
|
14904
|
+
return { picks: (copy.value ?? []).map((pick5) => ({ ...pick5, work: withCovers(sources.get(pick5.work.source), pick5.work) })), loading: copy.loading };
|
|
14894
14905
|
}
|
|
14895
14906
|
};
|
|
14896
14907
|
}
|
|
@@ -15381,7 +15392,7 @@ function createPersonRoutes({ hub, identity }) {
|
|
|
15381
15392
|
path: `${PERSON_PATH}/picks`,
|
|
15382
15393
|
methods: ["GET"],
|
|
15383
15394
|
requestBody: "buffered",
|
|
15384
|
-
fetch: handle((request, current, person) => current.picks(person, {
|
|
15395
|
+
fetch: handle((request, current, person) => current.picks(person, { language: param(request, "language") }))
|
|
15385
15396
|
},
|
|
15386
15397
|
{
|
|
15387
15398
|
path: `${PERSON_PATH}/steps`,
|
package/locale/en.json
CHANGED
|
@@ -268,10 +268,8 @@
|
|
|
268
268
|
"ratings.fine": "Fine",
|
|
269
269
|
"ratings.not-for-me": "Not for me",
|
|
270
270
|
"ratings.unfinished": "Didn't finish",
|
|
271
|
-
"picks.heading": "
|
|
271
|
+
"picks.heading": "For you",
|
|
272
272
|
"picks.hint": "Each with why it was picked",
|
|
273
|
-
"feed.picks": "For you",
|
|
274
|
-
"feed.picksHint": "Each with why it was picked",
|
|
275
273
|
"feed.trending": "Trending",
|
|
276
274
|
"feed.updated": "Updated {when}",
|
|
277
275
|
"feed.all": "Show all",
|
package/locale/fr.json
CHANGED
|
@@ -268,10 +268,8 @@
|
|
|
268
268
|
"ratings.fine": "Bien",
|
|
269
269
|
"ratings.not-for-me": "Pas pour moi",
|
|
270
270
|
"ratings.unfinished": "Pas fini",
|
|
271
|
-
"picks.heading": "
|
|
271
|
+
"picks.heading": "Pour vous",
|
|
272
272
|
"picks.hint": "Chacune avec la raison du choix",
|
|
273
|
-
"feed.picks": "Pour vous",
|
|
274
|
-
"feed.picksHint": "Chaque suggestion avec sa raison",
|
|
275
273
|
"feed.trending": "Tendances",
|
|
276
274
|
"feed.updated": "Mis à jour {when}",
|
|
277
275
|
"feed.all": "Tout afficher",
|
package/locale/zh.json
CHANGED
|
@@ -268,10 +268,8 @@
|
|
|
268
268
|
"ratings.fine": "还行",
|
|
269
269
|
"ratings.not-for-me": "不太喜欢",
|
|
270
270
|
"ratings.unfinished": "没看完",
|
|
271
|
-
"picks.heading": "
|
|
271
|
+
"picks.heading": "为你推荐",
|
|
272
272
|
"picks.hint": "每部都写了推荐理由",
|
|
273
|
-
"feed.picks": "为你推荐",
|
|
274
|
-
"feed.picksHint": "每个都带着推荐的理由",
|
|
275
273
|
"feed.trending": "热门",
|
|
276
274
|
"feed.updated": "{when}更新",
|
|
277
275
|
"feed.all": "显示全部",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soffits/dsh-media-hub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "A media hub for DeepSeek Harness: search shows, novels, ebooks and papers across sources, watch together in sync, and download books in the format you want onto your own shelf.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/web/books-view.js
CHANGED
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { Cover } from './details.js'
|
|
14
14
|
import { offeredFormats } from './formats.js'
|
|
15
|
-
import {
|
|
15
|
+
import { LibraryCard, LibraryCover } from './library-card.js'
|
|
16
|
+
import { Changes, Confirm, Icon, Menu, Spinner, bytes, canChat, chatAbout, fill, h, languageName, React, shelf, shelfUrl } from './ui.js'
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
export const FORMATS = ['', 'epub', 'pdf', 'txt', 'azw3', 'mobi']
|
|
@@ -152,28 +153,28 @@ export function useShelf() {
|
|
|
152
153
|
return { state, act }
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
/** One book of the shelf, as a card
|
|
156
|
+
/** One book of the shelf, as a library card like any other item: to save again, fetch again or delete. */
|
|
156
157
|
export function ShelfEntry({ t, entry, onAct }) {
|
|
157
158
|
const [confirming, setConfirming] = React.useState(false)
|
|
158
159
|
const act = async (path) => {
|
|
159
160
|
setConfirming(false)
|
|
160
161
|
await onAct(path, entry)
|
|
161
162
|
}
|
|
162
|
-
|
|
163
|
-
h(
|
|
164
|
-
h('
|
|
165
|
-
h(
|
|
166
|
-
h('span', { className: 'vsync-
|
|
167
|
-
entry.state === 'failed' && h('
|
|
168
|
-
entry.state === '
|
|
169
|
-
h('
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
163
|
+
const actions = confirming
|
|
164
|
+
? h(Confirm, { t, danger: true, question: t('shelf.deleteQuestion'), confirmLabel: t('shelf.delete'), onCancel: () => setConfirming(false), onConfirm: () => act('/remove') })
|
|
165
|
+
: h('span', { className: 'vsync-actions' },
|
|
166
|
+
h(ChatButton, { t, onClick: () => startChat(t, entry, entry.source) }),
|
|
167
|
+
entry.state === 'fetching' && h('span', { className: 'vsync-pending', role: 'status' }, h(Spinner), t('book.fetching')),
|
|
168
|
+
(entry.state === 'failed' || entry.state === 'removed') && h('button', { type: 'button', className: 'vsync-btn vsync-primary', onClick: () => act('/retry') }, t('shelf.again')),
|
|
169
|
+
entry.state === 'ready' && h(SaveLink, { t, entry }),
|
|
170
|
+
h(Menu, { label: t('library.more'), items: [{ label: t('shelf.delete'), danger: true, onSelect: () => setConfirming(true) }] }))
|
|
171
|
+
return h(LibraryCard, {
|
|
172
|
+
cover: h(LibraryCover, { pictures: [entry.cover], icon: h(Icon.Book, { size: 18 }) }),
|
|
173
|
+
title: h('span', { className: 'vsync-rowTitle' }, entry.title || entry.id),
|
|
174
|
+
badge: t('type.book'),
|
|
175
|
+
lead: [entry.author, entry.format.toUpperCase(), entry.bytes ? bytes(t, entry.bytes) : null].filter(Boolean),
|
|
176
|
+
rest: [entry.converted ? t('book.converted') : null, entry.state === 'removed' ? t('shelf.removed') : null].filter(Boolean),
|
|
177
|
+
aside: entry.state === 'failed' && h('span', { className: 'vsync-error', role: 'alert' }, entry.error),
|
|
178
|
+
actions,
|
|
179
|
+
})
|
|
179
180
|
}
|
package/web/feed-view.js
CHANGED
|
@@ -1,38 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What Discover shows before a search, for the source and category picked:
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* All sources the picks of every source are interleaved and each source's lists
|
|
6
|
-
* follow, headed by the source. Both come from dated copies the plugin keeps
|
|
2
|
+
* What Discover shows before a search, for the source and category picked: one
|
|
3
|
+
* list per board the source itself puts forward (its rank lists, new arrivals).
|
|
4
|
+
* Under All sources each source's lists follow, headed by the source. Both come from dated copies the plugin keeps
|
|
7
5
|
* (src/copies.js), so the page never waits on a site: while a copy is first
|
|
8
6
|
* being made the area shows a loading state, and the plugin's change signal
|
|
9
|
-
* brings the answer. A source
|
|
7
|
+
* brings the answer. A source with no lists shows nothing.
|
|
10
8
|
*
|
|
11
|
-
* The works are the same cards as search results
|
|
9
|
+
* The works are the same cards as search results; `PickedWork` is one under the
|
|
10
|
+
* reason it was picked (the Watching tab's picks).
|
|
12
11
|
*/
|
|
13
12
|
import { BookCard } from './books-view.js'
|
|
14
13
|
import { pick } from './i18n.js'
|
|
15
14
|
import { Result } from './result-card.js'
|
|
16
|
-
import { Changes, K, Spinner, api,
|
|
15
|
+
import { Changes, K, Spinner, api, fillNodes, h, query, React } from './ui.js'
|
|
17
16
|
|
|
18
17
|
/** Works of a list shown before "Show all". */
|
|
19
18
|
export const LIST_PREVIEW = 6
|
|
20
19
|
|
|
21
|
-
/** What the plugin has for one source and category: its trending lists
|
|
22
|
-
function useFeed(sourceId, kind
|
|
20
|
+
/** What the plugin has for one source and category: its trending lists. */
|
|
21
|
+
function useFeed(sourceId, kind) {
|
|
23
22
|
const { discover } = React.useContext(Changes)
|
|
24
23
|
const [feed, setFeed] = React.useState(null)
|
|
25
|
-
const key = `${sourceId}|${kind}
|
|
24
|
+
const key = `${sourceId}|${kind}`
|
|
26
25
|
React.useEffect(() => {
|
|
27
26
|
let live = true
|
|
28
27
|
const asked = query({ source: sourceId, kind })
|
|
29
|
-
|
|
28
|
+
api(`trending?${asked}`).then((trending) => {
|
|
30
29
|
if (!live) return
|
|
31
30
|
setFeed({
|
|
32
31
|
key,
|
|
33
32
|
trending: Array.isArray(trending.trending) ? trending.trending : [],
|
|
34
|
-
|
|
35
|
-
loading: trending.loading === true || picks.loading === true,
|
|
33
|
+
loading: trending.loading === true,
|
|
36
34
|
})
|
|
37
35
|
})
|
|
38
36
|
return () => { live = false }
|
|
@@ -53,27 +51,37 @@ function FeedSection({ id, title, hint, children }) {
|
|
|
53
51
|
children)
|
|
54
52
|
}
|
|
55
53
|
|
|
54
|
+
/** A work as the card of its kind: a book is downloaded in a format, anything else watched or listened to. */
|
|
55
|
+
export function WorkCard({ t, source, work, isBook, onOpen, onSaved, onFocus }) {
|
|
56
|
+
return isBook
|
|
57
|
+
? h(BookCard, { t, source, result: work })
|
|
58
|
+
: h(Result, { t, source, result: work, onOpen, onSaved, onFocus })
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** One picked work under the reason it was picked. */
|
|
62
|
+
export function PickedWork({ t, source, work, why, onOpen, onSaved, onFocus }) {
|
|
63
|
+
if (source === undefined) return null
|
|
64
|
+
const book = source.kinds.find(kind => kind.id === work.kind)?.media === 'book'
|
|
65
|
+
return h('li', { className: 'vsync-feedPick' },
|
|
66
|
+
h('p', { className: 'vsync-pickWhy' }, h(K.Icon, { name: 'sparkles', size: 14, tone: 'violet' }), h('span', null, why)),
|
|
67
|
+
h('ul', { className: 'vsync-rows' }, h(WorkCard, { t, source, work, isBook: book, onOpen, onSaved, onFocus })))
|
|
68
|
+
}
|
|
69
|
+
|
|
56
70
|
export function DiscoverFeed({ t, sourceId, kind, sourceOf, isBook, onOpen, onSaved, onFocus }) {
|
|
57
|
-
const feed = useFeed(sourceId, kind ?? ''
|
|
71
|
+
const feed = useFeed(sourceId, kind ?? '')
|
|
58
72
|
const [expanded, setExpanded] = React.useState(() => new Set())
|
|
59
73
|
if (feed === null) return h(Skeleton, { t })
|
|
60
|
-
const { trending,
|
|
61
|
-
if (trending.length === 0
|
|
74
|
+
const { trending, loading } = feed
|
|
75
|
+
if (trending.length === 0) return loading ? h(Skeleton, { t }) : null
|
|
62
76
|
|
|
63
77
|
const card = (work) => {
|
|
64
78
|
const from = sourceOf(work.source)
|
|
65
79
|
if (from === undefined) return null
|
|
66
|
-
return isBook(work.kind, from)
|
|
67
|
-
? h(BookCard, { key: `${from.id}:${work.id}`, t, source: from, result: work })
|
|
68
|
-
: h(Result, { key: `${from.id}:${work.id}`, t, source: from, result: work, onOpen, onSaved, onFocus })
|
|
80
|
+
return h(WorkCard, { key: `${from.id}:${work.id}`, t, source: from, work, isBook: isBook(work.kind, from), onOpen, onSaved, onFocus })
|
|
69
81
|
}
|
|
70
82
|
const merged = sourceId === 'all'
|
|
71
83
|
|
|
72
84
|
return h('div', { className: 'vsync-feed' },
|
|
73
|
-
picks.length > 0 && h(FeedSection, { id: 'vsync-feed-picks', title: t('feed.picks'), hint: t('feed.picksHint') },
|
|
74
|
-
h('ul', { className: 'vsync-rows vsync-results' }, picks.map(entry => h('li', { key: `${entry.work.source}:${entry.work.id}`, className: 'vsync-feedPick' },
|
|
75
|
-
h('p', { className: 'vsync-pickWhy' }, h(K.Icon, { name: 'sparkles', size: 14, tone: 'violet' }), h('span', null, entry.why)),
|
|
76
|
-
h('ul', { className: 'vsync-rows' }, card(entry.work)))))),
|
|
77
85
|
trending.flatMap(({ source: from, at, lists }) => lists.map((list) => {
|
|
78
86
|
const id = `${from}:${list.id}`
|
|
79
87
|
const name = pick(list.label, t.language).trim() || t('feed.trending')
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one card every library item is shown in, whatever it is: a cover, a title with its type, a line of facts, a
|
|
3
|
+
* muted line, tags, what to show beside them, the actions, and room below for what opens out (episodes, details).
|
|
4
|
+
* Shows and books differ only in what they put in these places.
|
|
5
|
+
*/
|
|
6
|
+
import { Icon, React, h } from './ui.js'
|
|
7
|
+
import { Picture } from './details.js'
|
|
8
|
+
|
|
9
|
+
/** The cover slot: the item's own picture when it has one, else a quiet icon, in the same size for every kind. */
|
|
10
|
+
export function LibraryCover({ pictures, icon }) {
|
|
11
|
+
return h(Picture, { pictures, className: 'vsync-poster vsync-libCover', emptyClassName: 'vsync-poster vsync-libCover vsync-posterEmpty', icon })
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {object} props
|
|
16
|
+
* @param {React.ReactNode} props.cover - a LibraryCover
|
|
17
|
+
* @param {React.ReactNode} props.title - the title (a button, or a form while renaming)
|
|
18
|
+
* @param {string} props.badge - what kind of item it is, in words
|
|
19
|
+
* @param {string[]} props.lead - the short line of facts
|
|
20
|
+
* @param {React.ReactNode[]} [props.rest] - the muted line
|
|
21
|
+
* @param {string[]} [props.tags]
|
|
22
|
+
* @param {React.ReactNode} [props.aside] - under the tags: a details toggle, an error
|
|
23
|
+
* @param {React.ReactNode} props.actions - the buttons, or a confirmation in their place
|
|
24
|
+
* @param {{ open: boolean, label: string, onToggle: () => void } | null} [props.expand] - the chevron of an item that opens out
|
|
25
|
+
* @param {React.ReactNode} [props.below] - what opens out
|
|
26
|
+
*/
|
|
27
|
+
export function LibraryCard({ cover, title, badge, lead, rest = [], tags = [], aside = null, actions, expand = null, below = null }) {
|
|
28
|
+
return h('li', { className: 'vsync-show' },
|
|
29
|
+
h('div', { className: 'vsync-row' },
|
|
30
|
+
expand
|
|
31
|
+
? h('button', { type: 'button', className: 'vsync-expand', 'aria-expanded': String(expand.open), 'aria-label': expand.label, onClick: expand.onToggle }, h(Icon.Chevron, { open: expand.open }))
|
|
32
|
+
: h('span', { className: 'vsync-expand', 'aria-hidden': true }),
|
|
33
|
+
cover,
|
|
34
|
+
h('span', { className: 'vsync-rowText' },
|
|
35
|
+
h('span', { className: 'vsync-cardHead' }, title, h('span', { className: 'vsync-badge' }, badge)),
|
|
36
|
+
h('span', { className: 'vsync-rowMeta vsync-rowLead' }, lead.map((part, n) => h('span', { key: n }, part))),
|
|
37
|
+
rest.length > 0 && h('span', { className: 'vsync-rowMeta vsync-rowMuted' }, rest.map((part, n) => h('span', { key: n }, part))),
|
|
38
|
+
tags.length > 0 && h('span', { className: 'vsync-tags' }, tags.map(tag => h('span', { key: tag, className: 'vsync-tag' }, tag))),
|
|
39
|
+
aside),
|
|
40
|
+
actions),
|
|
41
|
+
below)
|
|
42
|
+
}
|
package/web/library-view.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { ShelfEntry, useShelf } from './books-view.js'
|
|
7
7
|
import { Picture, WorkDetails } from './details.js'
|
|
8
|
+
import { LibraryCard, LibraryCover } from './library-card.js'
|
|
8
9
|
import { hasEpisodes, stoppedText } from './format.js'
|
|
9
10
|
import { Confirm, DAY_MS, EPISODE_BYTES, Icon, Menu, React, api, asPersonPaying, bytes, clock, day, displayName, fill, h, plural, post, query, watchMark } from './ui.js'
|
|
10
11
|
|
|
@@ -193,35 +194,32 @@ function ShowRow({ t, show, days, onOpen, onChanged, onOpenWork }) {
|
|
|
193
194
|
}))
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
|
|
197
|
-
h('
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
actions),
|
|
223
|
-
details && show.work && h('div', { className: 'vsync-showDetails' }, h(WorkDetails, { t, info: show.work, source: show.source.source, onFocus: work => onOpenWork(show.source.source, work) })),
|
|
224
|
-
open && h(Episodes, { t, show, onStart: start, onChanged }))
|
|
197
|
+
const title = mode === 'rename'
|
|
198
|
+
? h('form', {
|
|
199
|
+
id: `vsync-rename-${show.path}`,
|
|
200
|
+
onSubmit: async (event) => {
|
|
201
|
+
event.preventDefault()
|
|
202
|
+
const answer = await act(async () => post('library/rename', await asViewer(t, { path: show.path, name })))
|
|
203
|
+
if (!answer.error) setMode('idle')
|
|
204
|
+
},
|
|
205
|
+
}, h('input', { className: 'vsync-field vsync-inline', value: name, autoFocus: true, 'aria-label': t('library.rename'), onChange: event => setName(event.target.value), onKeyDown: (event) => { if (event.key === 'Escape') { setMode('idle'); setName(show.name) } } }))
|
|
206
|
+
: h('button', { type: 'button', className: 'vsync-rowTitle vsync-titleButton', onClick: () => setOpen(!open) }, show.kind === 'file' ? titleOf(show.name) : show.name)
|
|
207
|
+
return h(LibraryCard, {
|
|
208
|
+
cover: h(LibraryCover, { pictures: [show.work?.cover, show.frame], icon: show.media === 'audio' ? h(Icon.Audio, { size: 18 }) : h(Icon.Film, { size: 18 }) }),
|
|
209
|
+
title,
|
|
210
|
+
badge: t(show.media === 'audio' ? 'type.audio' : show.kind === 'file' ? 'type.video' : 'type.show'),
|
|
211
|
+
lead,
|
|
212
|
+
rest: [...rest, show.deletesAt !== null && h(Countdown, { key: 'countdown', t, show, days, onChanged })].filter(Boolean),
|
|
213
|
+
tags: show.work?.tags?.slice(0, 5) ?? [],
|
|
214
|
+
aside: h(React.Fragment, null,
|
|
215
|
+
show.work && h('button', { type: 'button', className: 'vsync-metaButton vsync-detailsToggle', 'aria-expanded': String(details), onClick: () => setDetails(!details) }, h(Icon.Chevron, { size: 12, open: details }), ' ', t(details ? 'search.hideDetails' : 'search.details')),
|
|
216
|
+
error && h('span', { className: 'vsync-error', role: 'alert' }, error)),
|
|
217
|
+
actions,
|
|
218
|
+
expand: hasEpisodes(episodeCount(show)) ? { open, label: t('library.episodesToggle'), onToggle: () => setOpen(!open) } : null,
|
|
219
|
+
below: h(React.Fragment, null,
|
|
220
|
+
details && show.work && h('div', { className: 'vsync-showDetails' }, h(WorkDetails, { t, info: show.work, source: show.source.source, onFocus: work => onOpenWork(show.source.source, work) })),
|
|
221
|
+
open && h(Episodes, { t, show, onStart: start, onChanged })),
|
|
222
|
+
})
|
|
225
223
|
}
|
|
226
224
|
|
|
227
225
|
/** Everything the person keeps, in one list of cards, each marked with what it is: shows and videos from the library, then the books of their shelf. */
|
package/web/panel.css
CHANGED
|
@@ -200,6 +200,8 @@
|
|
|
200
200
|
@media (width<=767px){.vsync-segment{display:flex}.vsync-seg{flex:1 0 auto}}
|
|
201
201
|
/* Library details, room preview, avatars, room side tabs */
|
|
202
202
|
.vsync-posterCover{width:36px;height:48px;object-fit:cover;border-radius:6px}
|
|
203
|
+
.vsync-poster.vsync-libCover{width:48px;height:64px;object-fit:cover;border-radius:6px}
|
|
204
|
+
.vsync-posterEmpty.vsync-libCover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
203
205
|
.vsync-showDetails{padding:4px 8px 12px 48px}
|
|
204
206
|
.vsync-detailsToggle{align-self:flex-start}
|
|
205
207
|
.vsync-preview{flex:none;width:96px;height:54px;border-radius:8px;object-fit:cover;background:var(--dsw-alias-interactive-bg-hover)}
|
|
@@ -247,8 +249,10 @@
|
|
|
247
249
|
.vsync-row>.vsync-rowText{flex:1 1 0;min-width:0}
|
|
248
250
|
.vsync-row>.vsync-actions,.vsync-row>.vsync-confirm{flex:1 1 100%;margin-left:0}
|
|
249
251
|
.vsync-row>.vsync-actions .vsync-btn{flex:1;height:36px}
|
|
252
|
+
.vsync-row>.vsync-actions .vsync-ask{flex:0 0 40px;padding:0}
|
|
250
253
|
.vsync-posterCover{width:56px;height:75px}
|
|
251
254
|
.vsync-poster{width:96px;height:54px}
|
|
255
|
+
.vsync-poster.vsync-libCover{width:56px;height:75px}
|
|
252
256
|
.vsync-preview{width:96px;height:54px}
|
|
253
257
|
.vsync-showDetails{padding:4px 0 12px}
|
|
254
258
|
.vsync-rowTitle{white-space:normal}
|
|
@@ -342,19 +346,10 @@
|
|
|
342
346
|
.vsync-ccRecap p{margin:0}
|
|
343
347
|
.vsync-ccRecapHead{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--dsw-alias-label-tertiary)}
|
|
344
348
|
.vsync-ccRecapText{margin-top:4px!important;line-height:22px}
|
|
345
|
-
.vsync-ccActions,.vsync-
|
|
349
|
+
.vsync-ccActions,.vsync-rateAnswers{display:flex;flex-wrap:wrap;gap:8px}
|
|
346
350
|
.vsync-rate{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:12px 16px}
|
|
347
351
|
.vsync-rateHead{display:flex;align-items:center;gap:12px;min-width:0}
|
|
348
352
|
.vsync-rateText{min-width:0}
|
|
349
|
-
.vsync-pickGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
|
|
350
|
-
.vsync-pickCard{display:flex;gap:12px;padding:12px}
|
|
351
|
-
.vsync-pickCover{flex:none;width:76px;height:114px;border-radius:8px;object-fit:cover}
|
|
352
|
-
.vsync-pickBody{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
|
|
353
|
-
.vsync-pickOpen{flex:none;padding:0;border:0;background:none;cursor:pointer;border-radius:8px}
|
|
354
|
-
.vsync-pickTitle{padding:0;border:0;background:none;color:inherit;font:inherit;font-weight:600;line-height:20px;text-align:start;overflow-wrap:anywhere;cursor:pointer}
|
|
355
|
-
@media (hover:hover){.vsync-pickTitle:hover{text-decoration:underline}}
|
|
356
|
-
.vsync-pickCard{transition:transform .15s ease}.vsync-pickCard:active{transform:scale(.99)}
|
|
357
|
-
@media (prefers-reduced-motion:reduce){.vsync-pickCard{transition:none}}
|
|
358
353
|
.vsync-pickWhy{display:flex;gap:6px;font-size:13px;line-height:19px;color:var(--dsw-alias-label-secondary)}
|
|
359
354
|
.vsync-pickWhy .uk-icon{margin-top:2px}
|
|
360
355
|
.vsync-feed{margin-top:8px}
|
|
@@ -362,12 +357,11 @@
|
|
|
362
357
|
.vsync-feedPick{list-style:none;display:flex;flex-direction:column;gap:4px}
|
|
363
358
|
.vsync-feedPick .vsync-pickWhy{margin:0 4px}
|
|
364
359
|
.vsync-feedSection .vsync-more{display:flex;margin-top:0}
|
|
365
|
-
.vsync-pickActions{margin-top:auto;padding-top:6px}
|
|
366
360
|
@media (width<=640px){.vsync-cc{flex-direction:column;gap:14px}.vsync-ccPoster{width:112px;height:150px}.vsync-ccStrip .uk-segmentsLabelled{flex-wrap:wrap;row-gap:4px}.vsync-ccStrip .uk-segments{flex-basis:100%}}
|
|
367
361
|
/* Interface chrome is not selectable and pictures don't drag; titles, recaps and reasons stay selectable. */
|
|
368
|
-
.vsync-pageTabs,.vsync-ccActions,.vsync-rateAnswers,.vsync-
|
|
362
|
+
.vsync-pageTabs,.vsync-ccActions,.vsync-rateAnswers,.vsync-ccLive,.vsync-sectionMeta,.vsync-sectionHead h2,.vsync-actions,.vsync-tabCount,.vsync-ccStrip,.vsync-rateHead .uk-tile{user-select:none;-webkit-user-select:none}
|
|
369
363
|
.vsync-page img{-webkit-user-drag:none;user-select:none;-webkit-user-select:none}
|
|
370
|
-
.vsync-ccActions .uk-touch
|
|
364
|
+
.vsync-ccActions .uk-touch .uk-touch,.vsync-rateAnswers .uk-touch{font-size:13px}
|
|
371
365
|
/* Points offer: an extra's price at the moment of the action */
|
|
372
366
|
.vsync-pointsOffer{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:40;display:flex;align-items:center;gap:12px;max-width:min(560px,calc(100% - 32px));padding:10px 12px 10px 16px;border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-base));box-shadow:var(--dsw-shadow-lv3)}
|
|
373
367
|
.vsync-pointsText{flex:1;min-width:0;font-size:13px;line-height:19px;color:var(--dsw-alias-label-primary)}
|
package/web/presence-view.js
CHANGED
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
* shows finished or removed lately (one tap writes a rating to the watch
|
|
5
5
|
* log), and picks from the recommender extension with the reason for each.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Btn, Changes, Icon, K, P, React, asPerson, asPersonPaying, displayName, fillNodes, h, query } from './ui.js'
|
|
7
|
+
import { PickedWork } from './feed-view.js'
|
|
8
|
+
import { Btn, Changes, K, P, React, asPerson, fillNodes, h, query } from './ui.js'
|
|
10
9
|
|
|
11
10
|
/** The answers, in order, with the icon each one shows (DSH's own where it has one). */
|
|
12
11
|
const ANSWERS = [
|
|
@@ -61,37 +60,11 @@ export function RatingsSection({ t, on, version }) {
|
|
|
61
60
|
h('ul', { className: 'vsync-cards' }, pending.map(ask => h(RatingRow, { key: ask.show, t, ask, onAnswered: show => setPending(pending.filter(other => other.show !== show)) }))))
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const [busy, setBusy] = React.useState(false)
|
|
67
|
-
const [error, setError] = React.useState(null)
|
|
68
|
-
const meta = [work.kind && t(`kind.${work.kind}`) !== `kind.${work.kind}` ? t(`kind.${work.kind}`) : null, work.year, Number.isFinite(work.score) ? [work.scoreLabel, work.score].filter(Boolean).join(' ') : null].filter(Boolean)
|
|
69
|
-
const together = async () => {
|
|
70
|
-
setBusy(true)
|
|
71
|
-
setError(null)
|
|
72
|
-
const answer = await asPersonPaying('fetch', { source: work.source, id: work.id, watch: true, together: true, language: t.language, by: await displayName(t('guest')) })
|
|
73
|
-
setBusy(false)
|
|
74
|
-
if (answer.error) return setError(answer.error)
|
|
75
|
-
if (answer.declined) return undefined
|
|
76
|
-
return onOpen(answer.room.id)
|
|
77
|
-
}
|
|
78
|
-
return h(K.Surface, { as: 'li', className: 'vsync-pickCard' },
|
|
79
|
-
h('button', { type: 'button', className: 'vsync-pickOpen', tabIndex: -1, 'aria-hidden': true, onClick: () => onOpenWork(work.source, work) },
|
|
80
|
-
h(Picture, { pictures: [work.cover], className: 'vsync-pickCover', emptyClassName: 'vsync-pickCover vsync-ccPosterEmpty', icon: h(Icon.Film, { size: 22 }) })),
|
|
81
|
-
h('div', { className: 'vsync-pickBody' },
|
|
82
|
-
h('button', { type: 'button', className: 'vsync-pickTitle', onClick: () => onOpenWork(work.source, work) }, work.title),
|
|
83
|
-
meta.length > 0 && h('p', { className: 'vsync-rowMeta' }, meta.join(' · ')),
|
|
84
|
-
h('p', { className: 'vsync-pickWhy' }, h(K.Icon, { name: 'sparkles', size: 14, tone: 'violet' }), h('span', null, why)),
|
|
85
|
-
h('div', { className: 'vsync-pickActions' },
|
|
86
|
-
h(Btn, { disabled: busy, onClick: together, icon: h(P.IconUsersOutlineRegular, { size: 16 }) }, t('room.watchTogether')),
|
|
87
|
-
h(FollowButton, { t, source: work.source, work, compact: true })),
|
|
88
|
-
error && h('p', { className: 'vsync-error', role: 'alert' }, error)))
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function PicksSection({ t, on, onOpen, onOpenWork }) {
|
|
63
|
+
/** The picks, each the card of its kind (watch it, or download the book) under the reason it was picked. */
|
|
64
|
+
export function PicksSection({ t, on, sources, onOpen, onSaved, onOpenWork }) {
|
|
92
65
|
const { discover } = React.useContext(Changes)
|
|
93
66
|
const [picks] = usePersonList(on, `picks?${query({ language: t.language })}`, 'picks', discover)
|
|
94
|
-
if (!picks || picks.length === 0) return null
|
|
67
|
+
if (!picks || picks.length === 0 || !sources) return null
|
|
95
68
|
return h(Section, { id: 'vsync-picks', title: t('picks.heading'), hint: t('picks.hint') },
|
|
96
|
-
h('ul', { className: 'vsync-
|
|
69
|
+
h('ul', { className: 'vsync-rows vsync-results' }, picks.map(({ work, why }) => h(PickedWork, { key: `${work.source}:${work.id}`, t, source: sources.find(one => one.id === work.source), work, why, onOpen, onSaved, onFocus: other => onOpenWork(other.source ?? work.source, other) }))))
|
|
97
70
|
}
|
package/web/watching-view.js
CHANGED
|
@@ -81,7 +81,7 @@ export function WatchingTab({ t, rooms, library, onOpen, onChanged, onGo, onOpen
|
|
|
81
81
|
h('h2', { id: 'vsync-news' }, t('follow.news')),
|
|
82
82
|
h('ul', { className: 'vsync-cards' }, news.map(show => h(NewsRow, { key: show.path, t, show, onOpen, onChanged })))),
|
|
83
83
|
h(RatingsSection, { t, on: presence.ratings === true, version: watchedVersion }),
|
|
84
|
-
h(PicksSection, { t, on: presence.picks === true, onOpen, onOpenWork }),
|
|
84
|
+
h(PicksSection, { t, on: presence.picks === true, sources, onOpen, onSaved: onChanged, onOpenWork }),
|
|
85
85
|
h(RoomsSection, { t, rooms, onOpen, onChanged }),
|
|
86
86
|
others.length > 0 && h('section', { className: 'vsync-section', 'aria-labelledby': 'vsync-continue' },
|
|
87
87
|
h('h2', { id: 'vsync-continue' }, t('watching.continue')),
|