mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-09 06:15:22 +02:00
Fix server crash on /me/progress/:libraryItemId/:episodeId? when episodeId is not passed in for a podcast library item #5058
This commit is contained in:
@@ -782,7 +782,14 @@ class User extends Model {
|
|||||||
error: 'Library item not found',
|
error: 'Library item not found',
|
||||||
statusCode: 404
|
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
|
mediaItemId = libraryItem.media.id
|
||||||
mediaProgress = libraryItem.media.mediaProgresses?.[0]
|
mediaProgress = libraryItem.media.mediaProgresses?.[0]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user