mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-08 00:08:14 +01:00
Item listening sessions endpoint returns 404 on not found media item
This commit is contained in:
parent
9c2ed279df
commit
23dcf684d9
@ -46,14 +46,11 @@ class MeController {
|
||||
const episode = await Database.podcastEpisodeModel.findByPk(req.params.episodeId)
|
||||
|
||||
if (!libraryItem || (libraryItem.mediaType === 'podcast' && !episode)) {
|
||||
Logger.error(`[PlaybackSessionManager] listening-sessions: Media item not found for library item id "${req.params.libraryItemId}"`)
|
||||
return {
|
||||
success: false,
|
||||
error: 'Media item not found'
|
||||
}
|
||||
Logger.error(`[MeController] Media item not found for library item id "${req.params.libraryItemId}"`)
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
const mediaItemId = episode ? episode.id : libraryItem.mediaId
|
||||
const mediaItemId = episode?.id || libraryItem.mediaId
|
||||
let listeningSessions = await this.getUserItemListeningSessionsHelper(req.user.id, mediaItemId)
|
||||
|
||||
const itemsPerPage = toNumber(req.query.itemsPerPage, 10) || 10
|
||||
|
Loading…
Reference in New Issue
Block a user