From 0de747a3372e3b259647815679305d3c7e2b5c7c Mon Sep 17 00:00:00 2001 From: Jerryplusy Date: Sat, 6 Dec 2025 02:13:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20refactor(lib/ai/renderer.js):=20?= =?UTF-8?q?update=20temporary=20directory=20structure=20for=20HTML=20files?= =?UTF-8?q?=20in=20crystelf-plugin=20=F0=9F=8E=A8=20refactor(lib/music/mus?= =?UTF-8?q?icRenderer.js):=20adjust=20temporary=20directory=20for=20music?= =?UTF-8?q?=20files=20in=20crystelf-plugin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ai/renderer.js | 4 ++-- lib/music/musicRenderer.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ai/renderer.js b/lib/ai/renderer.js index 3a9f8cf..cbab782 100644 --- a/lib/ai/renderer.js +++ b/lib/ai/renderer.js @@ -42,7 +42,7 @@ class Renderer { height: Math.ceil(rect.height), }); - const tempDir = path.join(process.cwd(), 'temp', 'html'); + const tempDir = path.join(process.cwd(), 'temp', 'html','crystelf-plugin'); if (!fs.existsSync(tempDir)) fs.mkdirSync(tempDir, { recursive: true }); const filepath = path.join(tempDir, `code_${Date.now()}.png`); @@ -79,7 +79,7 @@ class Renderer { height: Math.min(rect.height, 3000), deviceScaleFactor: 2, }); - const tempDir = path.join(process.cwd(), 'temp', 'html'); + const tempDir = path.join(process.cwd(), 'temp', 'html','crystelf-plugin'); if (!fs.existsSync(tempDir)) fs.mkdirSync(tempDir, { recursive: true }); const filepath = path.join(tempDir, `markdown_${Date.now()}.png`); diff --git a/lib/music/musicRenderer.js b/lib/music/musicRenderer.js index 4051c78..73a4b4c 100644 --- a/lib/music/musicRenderer.js +++ b/lib/music/musicRenderer.js @@ -8,7 +8,7 @@ const __dirname = path.dirname(__filename); class MusicRenderer { constructor() { - this.tempDir = path.join(__dirname, '..', '..','..','..', 'temp'); + this.tempDir = path.join(__dirname, '..', '..','..','..', 'temp','crystelf-plugin','music'); this.browser = null; }