audiobookshelf/server/objects/entities/Series.js
2022-03-08 19:31:44 -06:00

40 lines
711 B
JavaScript

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