mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-16 10:07:49 +02:00
Start of new data model
This commit is contained in:
40
server/objects/entities/Series.js
Normal file
40
server/objects/entities/Series.js
Normal file
@ -0,0 +1,40 @@
|
||||
class Series {
|
||||
constructor(series) {
|
||||
this.id = null
|
||||
this.name = null
|
||||
this.sequence = null
|
||||
this.addedAt = null
|
||||
this.updatedAt = null
|
||||
|
||||
if (series) {
|
||||
this.construct(series)
|
||||
}
|
||||
}
|
||||
|
||||
construct(series) {
|
||||
this.id = series.id
|
||||
this.name = series.name
|
||||
this.sequence = series.sequence
|
||||
this.addedAt = series.addedAt
|
||||
this.updatedAt = series.updatedAt
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
name: this.name,
|
||||
sequence: this.sequence,
|
||||
addedAt: this.addedAt,
|
||||
updatedAt: this.updatedAt
|
||||
}
|
||||
}
|
||||
|
||||
toJSONMinimal() {
|
||||
return {
|
||||
id: this.id,
|
||||
name: this.name,
|
||||
sequence: this.sequence
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = Series
|
Reference in New Issue
Block a user