diff --git a/content/posts/2026/2026-06-22-测试-20260622133641/index.md b/content/posts/2026/2026-06-22-测试-20260622133641/index.md deleted file mode 100644 index 3a55718c..00000000 --- a/content/posts/2026/2026-06-22-测试-20260622133641/index.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: 测试 -date: '2026-06-22' -slug: '20260622133641' -draft: false -categories: - - 生活 -tags: [] -author: 小赵 -layout: post ---- - -![image](1782106618092-AgACAgQA.jpg) - - - -[animation.gif.mp4](1782106624376-CgACAgQA.mp4) - - - -[file](1782106633158-BAACAgQA.mp4) - - -测试在 Linux 写作 - diff --git a/content/posts/2026/2026-06-22-测试-mqos99v6/1782106618092-AgACAgQA.jpg b/content/posts/2026/2026-06-22-测试-mqos99v6/1782106618092-AgACAgQA.jpg deleted file mode 100644 index bf7678d9..00000000 Binary files a/content/posts/2026/2026-06-22-测试-mqos99v6/1782106618092-AgACAgQA.jpg and /dev/null differ diff --git a/content/posts/2026/2026-06-22-测试-mqos99v6/1782106624376-CgACAgQA.mp4 b/content/posts/2026/2026-06-22-测试-mqos99v6/1782106624376-CgACAgQA.mp4 deleted file mode 100644 index c8a3a98d..00000000 Binary files a/content/posts/2026/2026-06-22-测试-mqos99v6/1782106624376-CgACAgQA.mp4 and /dev/null differ diff --git a/content/posts/2026/2026-06-22-测试-mqos99v6/1782106633158-BAACAgQA.mp4 b/content/posts/2026/2026-06-22-测试-mqos99v6/1782106633158-BAACAgQA.mp4 deleted file mode 100644 index 2d5f7b0d..00000000 Binary files a/content/posts/2026/2026-06-22-测试-mqos99v6/1782106633158-BAACAgQA.mp4 and /dev/null differ diff --git a/write-server/src/lib/bot/sessions.ts b/write-server/src/lib/bot/sessions.ts index 66a672ec..ed229653 100644 --- a/write-server/src/lib/bot/sessions.ts +++ b/write-server/src/lib/bot/sessions.ts @@ -15,7 +15,7 @@ export interface Session { dirPath: string; } -function computeDirPath(title: string, date?: string): string { +function computeDirPath(title: string, date?: string, slug?: string): string { const d = date ? new Date(date) : new Date(); const year = d.getFullYear().toString(); const dateStr = d.toISOString().slice(0, 10); @@ -23,9 +23,8 @@ function computeDirPath(title: string, date?: string): string { .replace(/[^\w一-鿿㐀-䶿]+/g, "-") .replace(/^-+|-+$/g, "") .toLowerCase() || "post"; - // 加时间戳避免同标题同天冲突 - const ts = Date.now().toString(36); - return path.join(CONTENT_DIR, year, `${dateStr}-${titlePart}-${ts}`); + const uniquePart = slug || Date.now().toString(36); + return path.join(CONTENT_DIR, year, `${dateStr}-${titlePart}-${uniquePart}`); } const sessions = new Map(); @@ -75,7 +74,7 @@ export function undoLastChunk(chatId: number): boolean { export function initSessionDir(chatId: number, title: string, date?: string): void { const s = getSession(chatId); if (!s.dirPath) { - s.dirPath = computeDirPath(title, date); + s.dirPath = computeDirPath(title, date, s.slug); } }