mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-02-06 00:16:02 +01:00
Add debug logs to playback sessions
This commit is contained in:
parent
17b930e13d
commit
337cf90c4b
@ -89,8 +89,11 @@ class SessionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async middleware(req, res, next) {
|
async middleware(req, res, next) {
|
||||||
var playbackSession = await this.db.getPlaybackSession(req.params.id)
|
const playbackSession = await this.db.getPlaybackSession(req.params.id)
|
||||||
if (!playbackSession) return res.sendStatus(404)
|
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) {
|
if (req.method == 'DELETE' && !req.user.canDelete) {
|
||||||
Logger.warn(`[SessionController] User attempted to delete without permission`, req.user)
|
Logger.warn(`[SessionController] User attempted to delete without permission`, req.user)
|
||||||
|
@ -154,7 +154,7 @@ class PlaybackSessionManager {
|
|||||||
|
|
||||||
if (libraryItem.mediaType === 'video') {
|
if (libraryItem.mediaType === 'video') {
|
||||||
if (shouldDirectPlay) {
|
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.videoTrack = libraryItem.media.getVideoTrack()
|
||||||
newPlaybackSession.playMethod = PlayMethod.DIRECTPLAY
|
newPlaybackSession.playMethod = PlayMethod.DIRECTPLAY
|
||||||
} else {
|
} else {
|
||||||
@ -163,7 +163,7 @@ class PlaybackSessionManager {
|
|||||||
} else {
|
} else {
|
||||||
let audioTracks = []
|
let audioTracks = []
|
||||||
if (shouldDirectPlay) {
|
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)
|
audioTracks = libraryItem.getDirectPlayTracklist(episodeId)
|
||||||
newPlaybackSession.playMethod = PlayMethod.DIRECTPLAY
|
newPlaybackSession.playMethod = PlayMethod.DIRECTPLAY
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user