Fix server crash on /me/progress/:libraryItemId/:episodeId? when episodeId is not passed in for a podcast library item #5058
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled
Integration Test / build and test (push) Has been cancelled
Run Unit Tests / Run Unit Tests (push) Has been cancelled

This commit is contained in:
advplyr 2026-02-14 17:17:12 -06:00
parent b01facc034
commit fa5fa7b788

View file

@ -782,7 +782,14 @@ class User extends Model {
error: 'Library item not found',
statusCode: 404
}
} else if (libraryItem.mediaType !== 'book') {
Logger.error(`[User] createUpdateMediaProgress: library item ${progressPayload.libraryItemId} is not a book`)
return {
error: 'Library item is not a book',
statusCode: 400
}
}
mediaItemId = libraryItem.media.id
mediaProgress = libraryItem.media.mediaProgresses?.[0]
}