mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-12 16:11:27 +08:00
🚧 WIP: add gallery db
This commit is contained in:
@@ -221,6 +221,7 @@ export function createTray () {
|
||||
setTimeout(() => {
|
||||
notification.show()
|
||||
}, i * 100)
|
||||
// FIXME: gallery db
|
||||
db.insert('uploaded', imgs[i])
|
||||
}
|
||||
handleCopyUrl(pasteText.join('\n'))
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user