mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-31 23:20:05 +02:00
Support for libraries and folder mapping, updating static cover path, detect reader.txt
This commit is contained in:
parent
a590e795e3
commit
577f3bead9
43 changed files with 2548 additions and 768 deletions
36
server/objects/Folder.js
Normal file
36
server/objects/Folder.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
class Folder {
|
||||
constructor(folder = null) {
|
||||
this.id = null
|
||||
this.fullPath = null
|
||||
this.libraryId = null
|
||||
this.addedAt = null
|
||||
|
||||
if (folder) {
|
||||
this.construct(folder)
|
||||
}
|
||||
}
|
||||
|
||||
construct(folder) {
|
||||
this.id = folder.id
|
||||
this.fullPath = folder.fullPath
|
||||
this.libraryId = folder.libraryId
|
||||
this.addedAt = folder.addedAt
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
fullPath: this.fullPath,
|
||||
libraryId: this.libraryId,
|
||||
addedAt: this.addedAt
|
||||
}
|
||||
}
|
||||
|
||||
setData(data) {
|
||||
this.id = data.id ? data.id : 'fol' + (Math.trunc(Math.random() * 1000) + Date.now()).toString(36)
|
||||
this.fullPath = data.fullPath
|
||||
this.libraryId = data.libraryId
|
||||
this.addedAt = Date.now()
|
||||
}
|
||||
}
|
||||
module.exports = Folder
|
Loading…
Add table
Add a link
Reference in a new issue