mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 14:18:03 +00:00
feat: 增加初始化sqlite的逻辑和其他更新
This commit is contained in:
parent
1b86cbbee1
commit
46fe2d734e
9 changed files with 118 additions and 158 deletions
17
src/main/ipcMain.ts
Normal file
17
src/main/ipcMain.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { ipcMain } from 'electron'
|
||||
import { db, Tables } from './db'
|
||||
|
||||
export enum Events {
|
||||
ClearAPICache = 'clear-api-cache',
|
||||
}
|
||||
|
||||
ipcMain.on(Events.ClearAPICache, () => {
|
||||
db.truncate(Tables.TRACK)
|
||||
db.truncate(Tables.ALBUM)
|
||||
db.truncate(Tables.ARTIST)
|
||||
db.truncate(Tables.PLAYLIST)
|
||||
db.truncate(Tables.ARTIST_ALBUMS)
|
||||
db.truncate(Tables.ACCOUNT_DATA)
|
||||
db.truncate(Tables.AUDIO)
|
||||
db.vacuum()
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue