🚧 WIP: add gallery db

This commit is contained in:
PiEgg
2021-07-27 00:15:11 +08:00
parent 76964ff1a5
commit c70c3aff78
8 changed files with 118 additions and 50 deletions

View File

@@ -221,6 +221,7 @@ export function createTray () {
setTimeout(() => {
notification.show()
}, i * 100)
// FIXME: gallery db
db.insert('uploaded', imgs[i])
}
handleCopyUrl(pasteText.join('\n'))

View File

@@ -77,13 +77,27 @@ class ConfigStore {
// @ts-ignore
return this.read().get(key).removeById(id).write()
}
getConfigPath () {
return CONFIG_PATH
}
}
export default new ConfigStore()
// v2.3.0 add gallery db
const dbStore = new DBStore(DB_PATH, 'gallery')
class GalleryDB {
private static instance: DBStore
private constructor () {
console.log('init gallery db')
}
public static getInstance (): DBStore {
if (!GalleryDB.instance) {
GalleryDB.instance = new DBStore(DB_PATH, 'gallery')
}
return GalleryDB.instance
}
}
export {
dbStore
GalleryDB
}