Merge pull request #5318 from mikiher/match-update-episode-enclosure
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Build and Push Docker Image / build (push) Waiting to run
Integration Test / build and test (push) Waiting to run
Run Unit Tests / Run Unit Tests (push) Waiting to run

Enhance PodcastController to handle enclosure updates
This commit is contained in:
advplyr 2026-06-20 17:06:32 -05:00 committed by GitHub
commit 9b92b5de34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -437,6 +437,17 @@ class PodcastController {
}
updatePayload[key] = req.body[key]
} else if (key === 'enclosure') {
const enclosure = req.body.enclosure
if (enclosure === null) {
updatePayload.enclosureURL = null
updatePayload.enclosureSize = null
updatePayload.enclosureType = null
} else if (typeof enclosure === 'object' && typeof enclosure.url === 'string') {
updatePayload.enclosureURL = enclosure.url
updatePayload.enclosureType = typeof enclosure.type === 'string' ? enclosure.type : null
updatePayload.enclosureSize = enclosure.length !== undefined && enclosure.length !== null ? enclosure.length : null
}
} else if (key === 'chapters' && Array.isArray(req.body[key]) && req.body[key].every((ch) => typeof ch === 'object' && ch.title && ch.start)) {
updatePayload[key] = req.body[key]
} else if (key === 'publishedAt' && typeof req.body[key] === 'number') {