mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-01-02 09:09:37 +00:00
Update:Remove oldSeries model
This commit is contained in:
parent
b6a86d11d2
commit
9f60017cfe
5 changed files with 17 additions and 123 deletions
|
|
@ -1,6 +1,5 @@
|
|||
const { DataTypes, Model, where, fn, col } = require('sequelize')
|
||||
|
||||
const oldSeries = require('../objects/entities/Series')
|
||||
const { getTitlePrefixAtEnd } = require('../utils/index')
|
||||
|
||||
class Series extends Model {
|
||||
|
|
@ -23,36 +22,6 @@ class Series extends Model {
|
|||
this.updatedAt
|
||||
}
|
||||
|
||||
getOldSeries() {
|
||||
return new oldSeries({
|
||||
id: this.id,
|
||||
name: this.name,
|
||||
description: this.description,
|
||||
libraryId: this.libraryId,
|
||||
addedAt: this.createdAt.valueOf(),
|
||||
updatedAt: this.updatedAt.valueOf()
|
||||
})
|
||||
}
|
||||
|
||||
static updateFromOld(oldSeries) {
|
||||
const series = this.getFromOld(oldSeries)
|
||||
return this.update(series, {
|
||||
where: {
|
||||
id: series.id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
static getFromOld(oldSeries) {
|
||||
return {
|
||||
id: oldSeries.id,
|
||||
name: oldSeries.name,
|
||||
nameIgnorePrefix: oldSeries.nameIgnorePrefix,
|
||||
description: oldSeries.description,
|
||||
libraryId: oldSeries.libraryId
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if series exists
|
||||
* @param {string} seriesId
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue