mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-15 11:54:56 +02:00
Support multi library 1.4.0
This commit is contained in:
parent
a65f7e6fad
commit
d9d34e87e0
29 changed files with 452 additions and 188 deletions
|
@ -6,6 +6,8 @@ class Library {
|
|||
this.name = null
|
||||
this.folders = []
|
||||
|
||||
this.lastScan = 0
|
||||
|
||||
this.createdAt = null
|
||||
this.lastUpdate = null
|
||||
|
||||
|
@ -74,6 +76,7 @@ class Library {
|
|||
|
||||
if (newFolders.length) {
|
||||
newFolders.forEach((folderData) => {
|
||||
folderData.libraryId = this.id
|
||||
var newFolder = new Folder()
|
||||
newFolder.setData(folderData)
|
||||
this.folders.push(newFolder)
|
||||
|
@ -91,5 +94,9 @@ class Library {
|
|||
checkFullPathInLibrary(fullPath) {
|
||||
return this.folders.find(folder => fullPath.startsWith(folder.fullPath))
|
||||
}
|
||||
|
||||
getFolderById(id) {
|
||||
return this.folders.find(folder => folder.id === id)
|
||||
}
|
||||
}
|
||||
module.exports = Library
|
Loading…
Add table
Add a link
Reference in a new issue