mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-08 08:24:59 +02:00
Update:Only load libraries from db when needed
This commit is contained in:
parent
1c40af3eef
commit
1d974375a0
13 changed files with 189 additions and 60 deletions
|
@ -258,11 +258,15 @@ class User {
|
|||
return hasUpdates
|
||||
}
|
||||
|
||||
getDefaultLibraryId(libraries) {
|
||||
/**
|
||||
* Get first available library id for user
|
||||
*
|
||||
* @param {string[]} libraryIds
|
||||
* @returns {string|null}
|
||||
*/
|
||||
getDefaultLibraryId(libraryIds) {
|
||||
// Libraries should already be in ascending display order, find first accessible
|
||||
var firstAccessibleLibrary = libraries.find(lib => this.checkCanAccessLibrary(lib.id))
|
||||
if (!firstAccessibleLibrary) return null
|
||||
return firstAccessibleLibrary.id
|
||||
return libraryIds.find(lid => this.checkCanAccessLibrary(lid)) || null
|
||||
}
|
||||
|
||||
// Returns most recent media progress w/ `media` object and optionally an `episode` object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue