Skip to content

Commit

Permalink
Fix stream endpoint serving folder
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants committed Mar 14, 2023
1 parent e2b52a4 commit a2375ee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/api/routes_scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,14 @@ func (rs sceneRoutes) Routes() chi.Router {
// region Handlers

func (rs sceneRoutes) StreamDirect(w http.ResponseWriter, r *http.Request) {

scene := r.Context().Value(sceneKey).(*models.Scene)
// #3526 - return 404 if the scene does not have any files
if scene.Path == "" {
w.WriteHeader(http.StatusNotFound)
return
}

sceneHash := scene.GetHash(config.GetInstance().GetVideoFileNamingAlgorithm())

filepath := manager.GetInstance().Paths.Scene.GetStreamPath(scene.Path, sceneHash)
Expand Down

0 comments on commit a2375ee

Please sign in to comment.