mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Fix /stream endpoint serving directory for fileless scenes (#3541)
* Fix stream endpoint serving folder * Hide stream link for fileless scenes
This commit is contained in:
parent
943a6d3be7
commit
9bae98cf57
2 changed files with 15 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -306,12 +306,14 @@ export const SceneFileInfoPanel: React.FC<ISceneFileInfoPanelProps> = (
|
|||
return (
|
||||
<>
|
||||
<dl className="container scene-file-info details-list">
|
||||
<URLField
|
||||
id="media_info.stream"
|
||||
url={props.scene.paths.stream}
|
||||
value={props.scene.paths.stream}
|
||||
truncate
|
||||
/>
|
||||
{props.scene.files.length > 0 && (
|
||||
<URLField
|
||||
id="media_info.stream"
|
||||
url={props.scene.paths.stream}
|
||||
value={props.scene.paths.stream}
|
||||
truncate
|
||||
/>
|
||||
)}
|
||||
{renderFunscript()}
|
||||
{renderInteractiveSpeed()}
|
||||
<URLField
|
||||
|
|
|
|||
Loading…
Reference in a new issue