mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-14 09:18:22 +02:00
Support multi library 1.4.0
This commit is contained in:
@ -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
|
Reference in New Issue
Block a user