feat: updates

This commit is contained in:
qier222 2022-04-16 21:14:03 +08:00
parent fc1c25f404
commit 7b6579e068
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
48 changed files with 1155 additions and 777 deletions

View file

@ -38,6 +38,7 @@ export interface TablesStructures {
[Tables.Audio]: {
id: number
br: number
type: 'mp3' | 'flac' | 'ogg' | 'wav' | 'm4a' | 'aac' | 'unknown'
source: 'netease' | 'migu' | 'kuwo' | 'kugou' | 'youtube'
url: string
updatedAt: number
@ -155,10 +156,7 @@ class DB {
upsertMany(data)
}
delete<T extends TableNames>(
table: T,
key: TablesStructures[T]['id']
) {
delete<T extends TableNames>(table: T, key: TablesStructures[T]['id']) {
return this.sqlite.prepare(`DELETE FROM ${table} WHERE id = ?`).run(key)
}