mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-05 06:26:26 +01:00
Start of new data model
This commit is contained in:
1 parent
2b7f53b0a7
commit
65793f7109
18 files changed
+672
-8
No files matched your search
@@ -0,0 +1,31 @@
|
||||
const FileMetadata = require('../metadata/FileMetadata')
|
||||
|
||||
class LibraryFile {
|
||||
constructor(file) {
|
||||
this.ino = null
|
||||
this.metadata = null
|
||||
this.addedAt = null
|
||||
this.updatedAt = null
|
||||
|
||||
if (file) {
|
||||
this.construct(file)
|
||||
}
|
||||
}
|
||||
|
||||
construct(file) {
|
||||
this.ino = file.ino
|
||||
this.metadata = new FileMetadata(file.metadata)
|
||||
this.addedAt = file.addedAt
|
||||
this.updatedAt = file.updatedAt
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
ino: this.ino,
|
||||
metadata: this.metadata.toJSON(),
|
||||
addedAt: this.addedAt,
|
||||
updatedAt: this.updatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = LibraryFile
|
||||
Reference in new issue
Block a user