Fix gallery can not obtain two same pictures

This commit is contained in:
2023-05-28 21:55:01 +08:00
parent 5d2d911d1a
commit b8d7c8313f
2 changed files with 26 additions and 2 deletions

View File

@@ -95,6 +95,19 @@ export async function download_task(
(t.is_original || !cfg.download_original_img) &&
(await exists(t.path))
) {
const p = db.get_pmeta_by_index(task.gid, i.index);
if (!p) {
const op = db.get_pmeta_by_token(
task.gid,
i.page_token,
);
if (op) {
op.index = i.index;
op.name = i.name;
db.add_pmeta(op);
return;
}
}
console.log("Already download page", i.index);
return;
}