mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-06 20:08:48 +02:00
Support server v1.4.0, multiple libraries, new static request routes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user