dsh-folia 4.0.5 → 4.0.6
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/lib/client.js +8 -0
- package/lib/routes/boot.js +9 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -17149,6 +17149,14 @@ window.__ModuleLoader__.load({
|
|
|
17149
17149
|
actions.push(btn(weT("使用中"), () => {}, true, false));
|
|
17150
17150
|
}
|
|
17151
17151
|
return React.createElement("div", { key: c.id, style: BOOT_STYLE.card },
|
|
17152
|
+
// 封面:站点给了真正的缩略图才显示;老条目没有就留空(不显示破图)。
|
|
17153
|
+
c.cover
|
|
17154
|
+
? React.createElement("img", {
|
|
17155
|
+
src: c.cover, alt: "", loading: "lazy", decoding: "async",
|
|
17156
|
+
style: { width: "100%", aspectRatio: "16 / 9", objectFit: "cover", borderRadius: "6px", background: "rgba(0,0,0,0.3)" },
|
|
17157
|
+
onError: (e) => { e.target.style.display = "none"; },
|
|
17158
|
+
})
|
|
17159
|
+
: null,
|
|
17152
17160
|
React.createElement("div", { style: BOOT_STYLE.title }, c.title || c.id),
|
|
17153
17161
|
React.createElement("div", { style: BOOT_STYLE.meta },
|
|
17154
17162
|
[c.durationSec ? Number(c.durationSec).toFixed(1) + "s" : null,
|
package/lib/routes/boot.js
CHANGED
|
@@ -190,6 +190,14 @@ async function fetchCandidatesUncached() {
|
|
|
190
190
|
bytes: Number(it && it.bytes) || null,
|
|
191
191
|
sha256: it && it.sha256 ? String(it.sha256) : null,
|
|
192
192
|
durationSec: it && it.durationMs ? Number(it.durationMs) / 1000 : null,
|
|
193
|
+
// 封面只认图片扩展名:站点上有几条老条目的 thumbUrl 直接指向 mp4
|
|
194
|
+
// (那时还没有缩略图功能)。把视频当 <img> 用只会得到一张破图。
|
|
195
|
+
cover: (() => {
|
|
196
|
+
const u = String((it && it.thumbUrl) || '');
|
|
197
|
+
if (!u) return null;
|
|
198
|
+
if (!/\.(jpg|jpeg|png|webp|gif|avif)(\?|#|$)/i.test(u)) return null;
|
|
199
|
+
return /^https?:/i.test(u) ? u : site + u;
|
|
200
|
+
})(),
|
|
193
201
|
faststart: true,
|
|
194
202
|
})).filter((c) => c.id && c.url);
|
|
195
203
|
if (clips.length) return { clips, error: null };
|
|
@@ -253,7 +261,7 @@ export function registerBootRoutes(webServer, c) {
|
|
|
253
261
|
if (known.has(it.id)) continue;
|
|
254
262
|
clips.push({
|
|
255
263
|
id: it.id, title: it.title, url: null, bytes: null, sha256: null,
|
|
256
|
-
durationSec: it.durationSec, faststart: true,
|
|
264
|
+
durationSec: it.durationSec, faststart: true, cover: null,
|
|
257
265
|
installed: true, localBytes: it.bytes, orphan: true,
|
|
258
266
|
});
|
|
259
267
|
}
|