diff --git a/packages/api/src/sync/image.ts b/packages/api/src/sync/image.ts index 187c6b5e..03e7ecf2 100644 --- a/packages/api/src/sync/image.ts +++ b/packages/api/src/sync/image.ts @@ -80,6 +80,7 @@ export const upsertImage = async (p: Pending, timeout = 3000) => { annotation: newImage.annotation, url: newImage.url, duration: newImage.duration, + noThumbnail: newImage.noThumbnail ?? false, // 文件夹只需要关联,删除处理在 handleFolder 中处理,删除 folder 会同时删除关联的 image folders: { connect: newImage.folders }, tags, diff --git a/themes/gallery/src/pages/index.tsx b/themes/gallery/src/pages/index.tsx index 3d5714f0..4e33d280 100644 --- a/themes/gallery/src/pages/index.tsx +++ b/themes/gallery/src/pages/index.tsx @@ -85,10 +85,11 @@ function Home() { {pages?.map((page) => { const photos = page.data?.map((image) => { const id = image.path.split("/").slice(-2)[0]; - const src = `http://${config?.ip}:${config?.serverPort}/static/${id}/${image.name}.${image.ext}`; + const host = `http://${config?.ip}:${config?.serverPort}`; + const src = `${host}/static/${id}/${image.name}.${image.ext}`; const thumbnailPath = image.noThumbnail ? src - : `http://${config?.ip}:${config?.serverPort}/static/${id}/${image.name}_thumbnail.png`; + : `${host}/static/${id}/${image.name}_thumbnail.png`; return { id: image.id, diff --git a/tooling/typescript/base.d.ts b/tooling/typescript/base.d.ts index 01a95da2..d6eb887e 100644 --- a/tooling/typescript/base.d.ts +++ b/tooling/typescript/base.d.ts @@ -32,6 +32,7 @@ declare global { width: number; duration: number; lastModified: number; + noThumbnail: boolean?; palettes: MetadataPalette[]; }