diff --git a/server/controllers/SessionController.js b/server/controllers/SessionController.js index fc3a25ef..346ffa03 100644 --- a/server/controllers/SessionController.js +++ b/server/controllers/SessionController.js @@ -89,8 +89,11 @@ class SessionController { } async middleware(req, res, next) { - var playbackSession = await this.db.getPlaybackSession(req.params.id) - if (!playbackSession) return res.sendStatus(404) + const playbackSession = await this.db.getPlaybackSession(req.params.id) + if (!playbackSession) { + Logger.error(`[SessionController] Unable to find playback session with id=${req.params.id}`) + return res.sendStatus(404) + } if (req.method == 'DELETE' && !req.user.canDelete) { Logger.warn(`[SessionController] User attempted to delete without permission`, req.user) diff --git a/server/managers/PlaybackSessionManager.js b/server/managers/PlaybackSessionManager.js index 6db65079..19bbfe13 100644 --- a/server/managers/PlaybackSessionManager.js +++ b/server/managers/PlaybackSessionManager.js @@ -154,7 +154,7 @@ class PlaybackSessionManager { if (libraryItem.mediaType === 'video') { if (shouldDirectPlay) { - Logger.debug(`[PlaybackSessionManager] "${user.username}" starting direct play session for item "${libraryItem.id}"`) + Logger.debug(`[PlaybackSessionManager] "${user.username}" starting direct play session for item "${libraryItem.id}" with id ${newPlaybackSession.id}`) newPlaybackSession.videoTrack = libraryItem.media.getVideoTrack() newPlaybackSession.playMethod = PlayMethod.DIRECTPLAY } else { @@ -163,7 +163,7 @@ class PlaybackSessionManager { } else { let audioTracks = [] if (shouldDirectPlay) { - Logger.debug(`[PlaybackSessionManager] "${user.username}" starting direct play session for item "${libraryItem.id}"`) + Logger.debug(`[PlaybackSessionManager] "${user.username}" starting direct play session for item "${libraryItem.id}" with id ${newPlaybackSession.id}`) audioTracks = libraryItem.getDirectPlayTracklist(episodeId) newPlaybackSession.playMethod = PlayMethod.DIRECTPLAY } else {