mirror of
https://github.com/lifegpc/eh-downloader.git
synced 2026-06-06 05:38:44 +08:00
Add new API /api/tag
This commit is contained in:
14
db.ts
14
db.ts
@@ -1007,6 +1007,20 @@ export class EhDb {
|
||||
);
|
||||
return s.length ? s[0] : undefined;
|
||||
}
|
||||
get_tag(id: number) {
|
||||
const s = this.db.queryEntries<Tag>(
|
||||
"SELECT * FROM tag WHERE id = ?;",
|
||||
[id],
|
||||
);
|
||||
return s.length ? s[0] : undefined;
|
||||
}
|
||||
get_tag_by_tag(tag: string) {
|
||||
const s = this.db.queryEntries<Tag>(
|
||||
"SELECT * FROM tag WHERE tag = ?;",
|
||||
[tag],
|
||||
);
|
||||
return s.length ? s[0] : undefined;
|
||||
}
|
||||
async get_task(id: number) {
|
||||
const s = await this.transaction(() =>
|
||||
this.db.queryEntries<Task>("SELECT * FROM task WHERE id = ?;", [id])
|
||||
|
||||
Reference in New Issue
Block a user