Add support to import gallery

This commit is contained in:
2024-06-07 20:49:21 +08:00
parent 0e841b61a5
commit fc81a4e1af
10 changed files with 533 additions and 19 deletions

4
db.ts
View File

@@ -814,8 +814,8 @@ export class EhDb {
check_download_task(gid: number | bigint, token: string) {
return this.transaction(() => {
const r = this.db.queryEntries<Task>(
"SELECT * FROM task WHERE type = ? AND gid = ? AND token = ?;",
[TaskType.Download, gid, token],
"SELECT * FROM task WHERE (type = ? OR type = ?) AND gid = ? AND token = ?;",
[TaskType.Download, TaskType.Import, gid, token],
);
return r.length ? r[0] : undefined;
});