dsh-folia 4.0.3 → 4.0.4
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/routes/inventory.js +3 -1
- package/package.json +1 -1
package/lib/routes/inventory.js
CHANGED
|
@@ -258,7 +258,9 @@ function foliaItemFromCatalog(it, base) {
|
|
|
258
258
|
// 预览优先级:**站点自己给的 preview 最高**(省掉宿主这一跳,也最省流量);
|
|
259
259
|
// 站点没给才退回宿主缩略图代理。只有预览走小图,`media` 永远是原图 ——
|
|
260
260
|
// 应用壁纸用的是 `media`,所以画质不受影响。
|
|
261
|
-
|
|
261
|
+
// 站点后台已经自动生成缩略图(thumbUrl,webp 小图),优先用它 ——
|
|
262
|
+
// 比宿主自己 ffmpeg 生成更快(少一跳),也比你手传更省事。
|
|
263
|
+
const sitePreview = foliaAbs(base, it && (it.thumbUrl || it.preview || it.poster)) || null;
|
|
262
264
|
const thumb = sitePreview ? null : (type === 'image' ? '/folia/site-thumb?u=' + encodeURIComponent(media) : null);
|
|
263
265
|
const extHit = String(media).match(/\.([a-z0-9]{2,5})(?:[?#]|$)/i);
|
|
264
266
|
const num = (v) => (Number.isFinite(Number(v)) && Number(v) > 0 ? Number(v) : undefined);
|