Update:Remove oldSeries model

This commit is contained in:
advplyr 2024-09-01 15:26:43 -05:00
parent b6a86d11d2
commit 9f60017cfe
5 changed files with 17 additions and 123 deletions

View file

@ -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