mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-20 13:53:19 +01:00
Update Series and Author model to be library specific
This commit is contained in:
@@ -11,6 +11,7 @@ class Author {
|
||||
this.imagePath = null
|
||||
this.addedAt = null
|
||||
this.updatedAt = null
|
||||
this.libraryId = null
|
||||
|
||||
if (author) {
|
||||
this.construct(author)
|
||||
@@ -25,6 +26,7 @@ class Author {
|
||||
this.imagePath = author.imagePath
|
||||
this.addedAt = author.addedAt
|
||||
this.updatedAt = author.updatedAt
|
||||
this.libraryId = author.libraryId
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
@@ -35,7 +37,8 @@ class Author {
|
||||
description: this.description,
|
||||
imagePath: this.imagePath,
|
||||
addedAt: this.addedAt,
|
||||
updatedAt: this.updatedAt
|
||||
updatedAt: this.updatedAt,
|
||||
libraryId: this.libraryId
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +55,7 @@ class Author {
|
||||
}
|
||||
}
|
||||
|
||||
setData(data) {
|
||||
setData(data, libraryId) {
|
||||
this.id = uuidv4()
|
||||
this.name = data.name
|
||||
this.description = data.description || null
|
||||
@@ -60,6 +63,7 @@ class Author {
|
||||
this.imagePath = data.imagePath || null
|
||||
this.addedAt = Date.now()
|
||||
this.updatedAt = Date.now()
|
||||
this.libraryId = libraryId
|
||||
}
|
||||
|
||||
update(payload) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user