This commit is contained in:
MagiX13 2025-12-16 17:55:07 -08:00 committed by GitHub
commit 44b7b450e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 126 additions and 7 deletions

View file

@ -40,6 +40,8 @@ class Podcast extends Model {
/** @type {string} */
this.language
/** @type {string} */
this.podcastFilenameFormat
/** @type {string} */
this.podcastType
/** @type {boolean} */
this.explicit
@ -102,6 +104,7 @@ class Podcast extends Model {
itunesId: typeof payload.metadata.itunesId === 'string' ? payload.metadata.itunesId : null,
itunesArtistId: typeof payload.metadata.itunesArtistId === 'string' ? payload.metadata.itunesArtistId : null,
language: typeof payload.metadata.language === 'string' ? payload.metadata.language : null,
podcastFilenameFormat: typeof payload.metadata.podcastFilenameFormat === 'string' ? payload.metadata.podcastFilenameFormat : null,
podcastType: typeof payload.metadata.type === 'string' ? payload.metadata.type : null,
explicit: !!payload.metadata.explicit,
autoDownloadEpisodes: !!payload.autoDownloadEpisodes,
@ -139,6 +142,7 @@ class Podcast extends Model {
itunesId: DataTypes.STRING,
itunesArtistId: DataTypes.STRING,
language: DataTypes.STRING,
podcastFilenameFormat: DataTypes.STRING,
podcastType: DataTypes.STRING,
explicit: DataTypes.BOOLEAN,
@ -194,6 +198,7 @@ class Podcast extends Model {
itunesId: this.itunesId,
itunesArtistId: this.itunesArtistId,
language: this.language,
podcastFilenameFormat: this.podcastFilenameFormat,
explicit: !!this.explicit,
podcastType: this.podcastType
}
@ -210,7 +215,7 @@ class Podcast extends Model {
let hasUpdates = false
if (payload.metadata) {
const stringKeys = ['title', 'author', 'releaseDate', 'feedUrl', 'imageUrl', 'description', 'itunesPageUrl', 'itunesId', 'itunesArtistId', 'language', 'type']
const stringKeys = ['title', 'author', 'releaseDate', 'feedUrl', 'imageUrl', 'description', 'itunesPageUrl', 'itunesId', 'itunesArtistId', 'language', 'type','podcastFilenameFormat']
stringKeys.forEach((key) => {
// Convert numbers to strings
if (typeof payload.metadata[key] === 'number') {
@ -408,6 +413,7 @@ class Podcast extends Model {
itunesArtistId: this.itunesArtistId,
explicit: this.explicit,
language: this.language,
podcastFilenameFormat: this.podcastFilenameFormat,
type: this.podcastType
}
}