Fix streaming scenes not able to be deleted (#2549)

* Don't navigate away from scene if delete failed
* Close connection on cancel
This commit is contained in:
WithoutPants
2022-05-04 09:27:22 +10:00
committed by GitHub
parent 0c2dc17e8e
commit e87fd516d6
4 changed files with 46 additions and 3 deletions

View File

@@ -164,7 +164,8 @@ func (rs sceneRoutes) streamTranscode(w http.ResponseWriter, r *http.Request, st
encoder := manager.GetInstance().FFMPEG
lm := manager.GetInstance().ReadLockManager
lockCtx := lm.ReadLock(r.Context(), scene.Path)
streamRequestCtx := manager.NewStreamRequestContext(w, r)
lockCtx := lm.ReadLock(streamRequestCtx, scene.Path)
defer lockCtx.Cancel()
stream, err := encoder.GetTranscodeStream(lockCtx, options)