mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-13 15:01:29 +00:00
Merge 464b720d9e into 47ea6b5092
This commit is contained in:
commit
3de0dedfd9
11 changed files with 236 additions and 1 deletions
|
|
@ -437,6 +437,10 @@ class LibraryItemController {
|
|||
* @param {Response} res
|
||||
*/
|
||||
startPlaybackSession(req, res) {
|
||||
if (!req.user.canStream) {
|
||||
Logger.warn(`User "${req.user.username}" attempted to stream without permission`)
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
if (!req.libraryItem.hasAudioTracks) {
|
||||
Logger.error(`[LibraryItemController] startPlaybackSession cannot playback ${req.libraryItem.id}`)
|
||||
return res.sendStatus(404)
|
||||
|
|
@ -454,6 +458,10 @@ class LibraryItemController {
|
|||
* @param {Response} res
|
||||
*/
|
||||
startEpisodePlaybackSession(req, res) {
|
||||
if (!req.user.canStream) {
|
||||
Logger.warn(`User "${req.user.username}" attempted to stream without permission`)
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
if (!req.libraryItem.isPodcast) {
|
||||
Logger.error(`[LibraryItemController] startEpisodePlaybackSession invalid media type ${req.libraryItem.id}`)
|
||||
return res.sendStatus(400)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue