Add db migration file to change audiobooks to library items with new data model

This commit is contained in:
advplyr 2022-03-09 19:23:17 -06:00
parent 65793f7109
commit b97ed953f7
17 changed files with 719 additions and 127 deletions

View file

@ -1,8 +1,9 @@
const { getId } = require('../../utils/index')
class Series {
constructor(series) {
this.id = null
this.name = null
this.sequence = null
this.addedAt = null
this.updatedAt = null
@ -14,7 +15,6 @@ class Series {
construct(series) {
this.id = series.id
this.name = series.name
this.sequence = series.sequence
this.addedAt = series.addedAt
this.updatedAt = series.updatedAt
}
@ -23,18 +23,24 @@ class Series {
return {
id: this.id,
name: this.name,
sequence: this.sequence,
addedAt: this.addedAt,
updatedAt: this.updatedAt
}
}
toJSONMinimal() {
toJSONMinimal(sequence) {
return {
id: this.id,
name: this.name,
sequence: this.sequence
sequence
}
}
setData(data) {
this.id = getId('ser')
this.name = data.name
this.addedAt = Date.now()
this.updatedAt = Date.now()
}
}
module.exports = Series