Support server v1.4.0, multiple libraries, new static request routes

This commit is contained in:
advplyr
2021-10-06 07:24:15 -05:00
parent a520a1fd8e
commit 993ff5341d
12 changed files with 355 additions and 44 deletions
+23
View File
@@ -503,6 +503,29 @@ class LocalStorage {
}
}
async setCurrentLibrary(library) {
try {
if (library) {
await Storage.set({ key: 'library', value: JSON.stringify(library) })
} else {
await Storage.remove({ key: 'library' })
}
} catch (error) {
console.error('[LocalStorage] Failed to set library', error)
}
}
async getCurrentLibrary() {
try {
var _value = (await Storage.get({ key: 'library' }) || {}).value || null
if (!_value) return null
return JSON.parse(_value)
} catch (error) {
console.error('[LocalStorage] Failed to get current library', error)
return null
}
}
async setDownloadFolder(folderObj) {
try {
if (folderObj) {