Commit 0b814293 authored by nanahira's avatar nanahira

bump

parent 8f3b076e
This diff is collapsed.
......@@ -28,17 +28,17 @@
},
"homepage": "https://github.com/koishijs/koishi-plugin-picsource-localfs",
"dependencies": {
"koishi-thirdeye": "^11.1.16",
"koishi-thirdeye": "^11.1.20",
"read-dir-deep": "^7.0.1"
},
"peerDependencies": {
"koishi": "^4.10.6",
"koishi-plugin-pics": "^10.6.1"
"koishi": "^4.11.0",
"koishi-plugin-pics": "^10.6.4"
},
"devDependencies": {
"@koishijs/plugin-console": "^4.7.1",
"@koishijs/plugin-database-memory": "^2.0.1",
"@koishijs/plugin-sandbox": "^2.4.0",
"@koishijs/plugin-console": "^5.0.2",
"@koishijs/plugin-database-memory": "^2.2.0",
"@koishijs/plugin-sandbox": "^2.5.0",
"@types/jest": "^29.2.0",
"@types/node": "^16.11.4",
"@typescript-eslint/eslint-plugin": "^4.33.0",
......@@ -53,7 +53,7 @@
"ts-jest": "^29.0.3",
"ts-loader": "^9.3.1",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
"typescript": "^4.9.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0",
"ws": "^8.3.0"
......
......@@ -22,11 +22,9 @@ export default class LocalSource extends PicSourcePlugin(LocalSourceConfig) {
return null;
}
const filename = Random.pick(files);
const fileBase64 = (await fs.promises.readFile(filename)).toString(
'base64',
);
const data = await this.pics.urlToBuffer(`file://${filename}`);
return {
url: `base64://${fileBase64}`,
url: await this.pics.bufferToUrl(data.buffer, data.mime),
description: this.config.displayFilename
? path.basename(filename)
: undefined,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment