Skip to content

Commit a932df9

Browse files
authored
Merge pull request #2 from ChanMo/release/v0.8.16
release: v0.8.16 修复集合封面视频类型渲染
2 parents 0e1c4db + 9219079 commit a932df9

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "TikLocal"
3-
version = "0.8.15"
3+
version = "0.8.16"
44
description = "A local media server that combines the features of TikTok and Pinterest"
55
authors = ["ChanMo <chan.mo@outlook.com>"]
66
readme = "README.md"

tiklocal/templates/collections.html

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
[data-theme="dark"] .collection-cover {
7777
background: linear-gradient(135deg, #1e293b, #334155);
7878
}
79-
.collection-cover img {
79+
.collection-cover img,
80+
.collection-cover video {
8081
width: 100%;
8182
height: 100%;
8283
object-fit: cover;
@@ -354,9 +355,15 @@ <h3 class="text-sm font-semibold text-slate-900 dark:text-slate-100 mb-3">重命
354355
const count = Number(item.item_count || 0);
355356
const detail = String(item.detail_url || '#');
356357
const name = escapeHtml(item.name || '未命名集合');
357-
const coverHtml = cover
358-
? `<img src="${cover}" alt="" loading="lazy" />`
359-
: `<div class="collection-cover-empty"><i data-feather="folder"></i></div>`;
358+
const coverType = String(item.cover_type || 'image');
359+
let coverHtml;
360+
if (!cover) {
361+
coverHtml = `<div class="collection-cover-empty"><i data-feather="folder"></i></div>`;
362+
} else if (coverType === 'video') {
363+
coverHtml = `<video src="${cover}" muted preload="metadata" playsinline></video>`;
364+
} else {
365+
coverHtml = `<img src="${cover}" alt="" loading="lazy" />`;
366+
}
360367
return `
361368
<article class="collection-item" data-collection-id="${id}">
362369
<a class="collection-card" href="${detail}">

tiklocal/templates/tiktok.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,6 @@ <h3>加入集合</h3>
15271527
const removeCount = 30;
15281528
const removed = flowSession.dropHead(removeCount);
15291529
removed.forEach((entry) => entry.el.remove());
1530-
setCurrentIndex(Math.max(0, getCurrentIndex() - removeCount));
15311530
}
15321531
} catch (error) {
15331532
flowSession.setHasMore(false);

0 commit comments

Comments
 (0)