Skip to content

Commit

Permalink
修复撤回图片后预览图一直转圈
Browse files Browse the repository at this point in the history
  • Loading branch information
xh321 committed Sep 15, 2024
1 parent 4b95ce1 commit e5a4242
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
24 changes: 9 additions & 15 deletions imgDownloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,15 @@ class ImgDownloader {
const thumbMap = new Map([
[
0,
pic.sourcePath
.replace("Ori", "Thumb")
.replace(pic.md5HexStr, pic.md5HexStr + "_0_recalled"),
pic.sourcePath,
],
[
198,
pic.sourcePath
.replace("Ori", "Thumb")
.replace(pic.md5HexStr, pic.md5HexStr + "_198_recalled"),
pic.sourcePath,
],
[
720,
pic.sourcePath
.replace("Ori", "Thumb")
.replace(pic.md5HexStr, pic.md5HexStr + "_720_recalled"),
pic.sourcePath,
],
]);
const picUrl = await this.getImageUrl(el.picElement);
Expand All @@ -87,12 +81,12 @@ class ImgDownloader {
this.output("Pic already existed, skip.", pic.sourcePath);
}
//需要复制原图到预览图目录
thumbMap.forEach(async (el, key) => {
if (!fs.existsSync(el)) {
this.output("Copy thumbs:", `source: ${pic.sourcePath} to ${el}`);
fs.copyFile(pic.sourcePath, el);
}
});
// thumbMap.forEach(async (el, key) => {
// if (!fs.existsSync(el)) {
// this.output("Copy thumbs:", `source: ${pic.sourcePath} to ${el}`);
// fs.copyFile(pic.sourcePath, el);
// }
// });

// 修复本地数据中的错误
if (
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "防撤回",
"slug": "anti_recall",
"description": "防止QQNT撤回消息",
"version": "0.2.45",
"version": "0.2.46",
"icon": "./icon.png",
"authors": [
{
Expand All @@ -16,7 +16,7 @@
"repo": "xh321/LiteLoaderQQNT-Anti-Recall",
"branch": "master",
"release": {
"tag": "0.2.45",
"tag": "0.2.46",
"file": "qq-anti-recall.zip"
}
},
Expand Down

0 comments on commit e5a4242

Please # to comment.