mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-14 11:25:02 +02:00
Update Series and Author model to be library specific
This commit is contained in:
parent
1d13d0a553
commit
0ac63b2678
10 changed files with 119 additions and 61 deletions
|
@ -7,6 +7,7 @@ class Series {
|
|||
this.description = null
|
||||
this.addedAt = null
|
||||
this.updatedAt = null
|
||||
this.libraryId = null
|
||||
|
||||
if (series) {
|
||||
this.construct(series)
|
||||
|
@ -19,6 +20,7 @@ class Series {
|
|||
this.description = series.description || null
|
||||
this.addedAt = series.addedAt
|
||||
this.updatedAt = series.updatedAt
|
||||
this.libraryId = series.libraryId
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
@ -27,7 +29,8 @@ class Series {
|
|||
name: this.name,
|
||||
description: this.description,
|
||||
addedAt: this.addedAt,
|
||||
updatedAt: this.updatedAt
|
||||
updatedAt: this.updatedAt,
|
||||
libraryId: this.libraryId
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,12 +42,13 @@ class Series {
|
|||
}
|
||||
}
|
||||
|
||||
setData(data) {
|
||||
setData(data, libraryId) {
|
||||
this.id = uuidv4()
|
||||
this.name = data.name
|
||||
this.description = data.description || null
|
||||
this.addedAt = Date.now()
|
||||
this.updatedAt = Date.now()
|
||||
this.libraryId = libraryId
|
||||
}
|
||||
|
||||
update(series) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue