Remove autoGenerateChapters flag, migration and version bump

This commit is contained in:
Harry Rose 2026-03-17 18:59:12 +00:00
parent 0227302fc0
commit 8710816a6f
8 changed files with 6 additions and 167 deletions

View file

@ -53,8 +53,6 @@ class Podcast extends Model {
this.maxEpisodesToKeep
/** @type {number} */
this.maxNewEpisodesToDownload
/** @type {boolean} */
this.autoGenerateChapters
/** @type {string} */
this.coverPath
/** @type {string[]} */
@ -108,7 +106,6 @@ class Podcast extends Model {
explicit: !!payload.metadata.explicit,
autoDownloadEpisodes: !!payload.autoDownloadEpisodes,
autoDownloadSchedule: autoDownloadSchedule || global.ServerSettings.podcastEpisodeSchedule,
autoGenerateChapters: !!payload.autoGenerateChapters,
lastEpisodeCheck: new Date(),
maxEpisodesToKeep: 0,
maxNewEpisodesToDownload: 3,
@ -148,7 +145,6 @@ class Podcast extends Model {
autoDownloadEpisodes: DataTypes.BOOLEAN,
autoDownloadSchedule: DataTypes.STRING,
lastEpisodeCheck: DataTypes.DATE,
autoGenerateChapters: DataTypes.BOOLEAN,
maxEpisodesToKeep: DataTypes.INTEGER,
maxNewEpisodesToDownload: DataTypes.INTEGER,
coverPath: DataTypes.STRING,
@ -277,10 +273,6 @@ class Podcast extends Model {
this.autoDownloadSchedule = payload.autoDownloadSchedule
hasUpdates = true
}
if (payload.autoGenerateChapters !== undefined && payload.autoGenerateChapters !== this.autoGenerateChapters) {
this.autoGenerateChapters = !!payload.autoGenerateChapters
hasUpdates = true
}
if (typeof payload.lastEpisodeCheck === 'number' && payload.lastEpisodeCheck !== this.lastEpisodeCheck?.valueOf()) {
this.lastEpisodeCheck = payload.lastEpisodeCheck
hasUpdates = true
@ -449,7 +441,6 @@ class Podcast extends Model {
autoDownloadEpisodes: this.autoDownloadEpisodes,
autoDownloadSchedule: this.autoDownloadSchedule,
lastEpisodeCheck: this.lastEpisodeCheck?.valueOf() || null,
autoGenerateChapters: this.autoGenerateChapters,
maxEpisodesToKeep: this.maxEpisodesToKeep,
maxNewEpisodesToDownload: this.maxNewEpisodesToDownload
}
@ -466,7 +457,6 @@ class Podcast extends Model {
autoDownloadEpisodes: this.autoDownloadEpisodes,
autoDownloadSchedule: this.autoDownloadSchedule,
lastEpisodeCheck: this.lastEpisodeCheck?.valueOf() || null,
autoGenerateChapters: this.autoGenerateChapters,
maxEpisodesToKeep: this.maxEpisodesToKeep,
maxNewEpisodesToDownload: this.maxNewEpisodesToDownload,
size: this.size
@ -491,7 +481,6 @@ class Podcast extends Model {
autoDownloadEpisodes: this.autoDownloadEpisodes,
autoDownloadSchedule: this.autoDownloadSchedule,
lastEpisodeCheck: this.lastEpisodeCheck?.valueOf() || null,
autoGenerateChapters: this.autoGenerateChapters,
maxEpisodesToKeep: this.maxEpisodesToKeep,
maxNewEpisodesToDownload: this.maxNewEpisodesToDownload,
size: this.size

View file

@ -58,10 +58,9 @@ class PodcastEpisode extends Model {
*
* @param {import('../utils/podcastUtils').RssPodcastEpisode} rssPodcastEpisode
* @param {string} podcastId
* @param {boolean} autoGenerateChapters
* @param {import('../objects/files/AudioFile')} audioFile
*/
static async createFromRssPodcastEpisode(rssPodcastEpisode, podcastId, autoGenerateChapters, audioFile) {
static async createFromRssPodcastEpisode(rssPodcastEpisode, podcastId, audioFile) {
const podcastEpisode = {
index: null,
season: rssPodcastEpisode.season,
@ -88,8 +87,8 @@ class PodcastEpisode extends Model {
podcastEpisode.chapters = audioFile.chapters.map((ch) => ({ ...ch }))
} else if (rssPodcastEpisode.chapters?.length) {
podcastEpisode.chapters = rssPodcastEpisode.chapters.map((ch) => ({ ...ch }))
} else if (autoGenerateChapters) {
Logger.info("[PodcastEpisode] New episode doesn't have chapters, attempting to generate them from timestamps", rssPodcastEpisode.title)
} else {
Logger.debug("[PodcastEpisode] New episode doesn't have chapters, attempting to generate them from timestamps", rssPodcastEpisode.title)
try {
podcastEpisode.chapters = parsePodcastDescriptionForChapters.parse(podcastEpisode.description, podcastEpisode.audioFile.duration)
} catch (error) {