🎨 refactor(lib/ai/renderer.js): update temporary directory structure for HTML files in crystelf-plugin

🎨 refactor(lib/music/musicRenderer.js): adjust temporary directory for music files in crystelf-plugin
This commit is contained in:
Jerry 2025-12-06 02:13:01 +08:00
parent fcbb10d2f5
commit 0de747a337
2 changed files with 3 additions and 3 deletions

View File

@ -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`);

View File

@ -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;
}