mirror of
https://github.com/truewhile/MeBox.git
synced 2026-11-16 04:44:23 +08:00
优化
This commit is contained in:
@@ -464,7 +464,9 @@ export function HomeLibrariesSection({
|
||||
pinned={pinnedIds.includes(lib.id)}
|
||||
onTogglePin={onTogglePin ? () => onTogglePin(lib.id) : undefined}
|
||||
onVisible={() => {
|
||||
if (!lib.cover_url) {
|
||||
// 服务端会生成库封面时不必再为首屏卡片拉成员预览;
|
||||
// 远程挂载库的封面仍由卡片拼图兜底。
|
||||
if (!lib.cover_url && !lib.cover_image_url) {
|
||||
queuePreview(lib.id)
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -43,5 +43,12 @@ export function getLibraryArtworks(
|
||||
if (library.cover_url) {
|
||||
return [{ src: library.cover_url, version: library.updated_at }]
|
||||
}
|
||||
// 服务端生成的库封面(成员海报竖切拼图):所有客户端共用一张图,
|
||||
// 不再由前端拿两张卡片自己拼格子。
|
||||
// version 里带一个版次后缀:接口地址是固定的,靠它让浏览器在拼图规则
|
||||
// 调整(如田字格改成竖切)后丢掉旧缓存重新拉图。
|
||||
if (library.cover_image_url) {
|
||||
return [{ src: library.cover_image_url, version: `${library.updated_at}-c3` }]
|
||||
}
|
||||
return libraryArtworkItems(cards)
|
||||
}
|
||||
|
||||
@@ -130,14 +130,6 @@ export const generalSettingsGroup: SettingGroup = {
|
||||
defaultValue: '256',
|
||||
placeholder: '256',
|
||||
},
|
||||
{
|
||||
key: 'cache.images_originals_ttl_hours',
|
||||
label: '原图保留时长 (小时)',
|
||||
type: 'number',
|
||||
hint: '原图缓存的最长保留时间,超过即删除(默认 168 小时 = 7 天)。缩略图都已生成时原图就不再需要,缩短它可以让原图缓存保持在一个滚动窗口内。设为 0 表示不按时间淘汰',
|
||||
defaultValue: '168',
|
||||
placeholder: '168',
|
||||
},
|
||||
{
|
||||
key: 'https.enabled',
|
||||
label: '启用 HTTPS',
|
||||
|
||||
@@ -15,6 +15,12 @@ export interface Library {
|
||||
path: string
|
||||
type: string
|
||||
cover_url?: string
|
||||
/**
|
||||
* 服务端生成的封面地址(成员海报拼图)。管理员自定义 cover_url 时等于
|
||||
* 该地址,否则指向 `/api/libraries/:id/cover`。Web/App 统一读这个字段,
|
||||
* 不用再自己用卡片拼格子。
|
||||
*/
|
||||
cover_image_url?: string
|
||||
enabled: boolean
|
||||
sort_order?: number
|
||||
carousel_enabled?: boolean
|
||||
|
||||
Reference in New Issue
Block a user