koishi-plugin-checkgal 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/api.js +3 -3
  2. package/package.json +1 -1
package/lib/api.js CHANGED
@@ -45,7 +45,7 @@ class TouchGalAPI {
45
45
  constructor(ctx) {
46
46
  this.http = ctx.http;
47
47
  this.logger = ctx.logger('checkgal-api');
48
- this.tempDir = path.join(ctx.app.baseDir, 'temp');
48
+ this.tempDir = path.join(ctx.app.baseDir, 'data', 'temp', 'checkgal');
49
49
  ctx.on('ready', async () => {
50
50
  await fs_1.promises.mkdir(this.tempDir, { recursive: true });
51
51
  });
@@ -116,8 +116,8 @@ class TouchGalAPI {
116
116
  const fileName = `${hash}.jpg`;
117
117
  const filePath = path.join(this.tempDir, fileName);
118
118
  await fs_1.promises.writeFile(filePath, imageBuffer);
119
- // 返回相对于 koishi 根目录的相对路径
120
- return `temp/${fileName}`;
119
+ // 返回绝对文件路径的 file:// URL
120
+ return `file://${filePath}`;
121
121
  }
122
122
  catch (error) {
123
123
  this.logger.error(`Failed to download or convert image from ${url}:`, error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-checkgal",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "个人测试请勿使用",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",