mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 08:14:40 +02:00
Fixes for db migration & local playback sessions
This commit is contained in:
parent
63e5cf2e60
commit
d99b2c25e8
13 changed files with 750 additions and 119 deletions
|
@ -15,6 +15,7 @@ module.exports = (sequelize) => {
|
|||
libraryItemId: libraryItemId || null,
|
||||
podcastId: this.podcastId,
|
||||
id: this.id,
|
||||
oldEpisodeId: this.extraData?.oldEpisodeId || null,
|
||||
index: this.index,
|
||||
season: this.season,
|
||||
episode: this.episode,
|
||||
|
@ -38,6 +39,10 @@ module.exports = (sequelize) => {
|
|||
}
|
||||
|
||||
static getFromOld(oldEpisode) {
|
||||
const extraData = {}
|
||||
if (oldEpisode.oldEpisodeId) {
|
||||
extraData.oldEpisodeId = oldEpisode.oldEpisodeId
|
||||
}
|
||||
return {
|
||||
id: oldEpisode.id,
|
||||
index: oldEpisode.index,
|
||||
|
@ -54,7 +59,8 @@ module.exports = (sequelize) => {
|
|||
publishedAt: oldEpisode.publishedAt,
|
||||
podcastId: oldEpisode.podcastId,
|
||||
audioFile: oldEpisode.audioFile?.toJSON() || null,
|
||||
chapters: oldEpisode.chapters
|
||||
chapters: oldEpisode.chapters,
|
||||
extraData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +85,8 @@ module.exports = (sequelize) => {
|
|||
publishedAt: DataTypes.DATE,
|
||||
|
||||
audioFile: DataTypes.JSON,
|
||||
chapters: DataTypes.JSON
|
||||
chapters: DataTypes.JSON,
|
||||
extraData: DataTypes.JSON
|
||||
}, {
|
||||
sequelize,
|
||||
modelName: 'podcastEpisode'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue