mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03: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:
@@ -88,7 +88,14 @@ func (rs sceneRoutes) Routes() chi.Router {
|
|||||||
// region Handlers
|
// region Handlers
|
||||||
|
|
||||||
func (rs sceneRoutes) StreamDirect(w http.ResponseWriter, r *http.Request) {
|
func (rs sceneRoutes) StreamDirect(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
scene := r.Context().Value(sceneKey).(*models.Scene)
|
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())
|
sceneHash := scene.GetHash(config.GetInstance().GetVideoFileNamingAlgorithm())
|
||||||
|
|
||||||
filepath := manager.GetInstance().Paths.Scene.GetStreamPath(scene.Path, sceneHash)
|
filepath := manager.GetInstance().Paths.Scene.GetStreamPath(scene.Path, sceneHash)
|
||||||
|
|||||||
@@ -306,12 +306,14 @@ export const SceneFileInfoPanel: React.FC<ISceneFileInfoPanelProps> = (
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<dl className="container scene-file-info details-list">
|
<dl className="container scene-file-info details-list">
|
||||||
<URLField
|
{props.scene.files.length > 0 && (
|
||||||
id="media_info.stream"
|
<URLField
|
||||||
url={props.scene.paths.stream}
|
id="media_info.stream"
|
||||||
value={props.scene.paths.stream}
|
url={props.scene.paths.stream}
|
||||||
truncate
|
value={props.scene.paths.stream}
|
||||||
/>
|
truncate
|
||||||
|
/>
|
||||||
|
)}
|
||||||
{renderFunscript()}
|
{renderFunscript()}
|
||||||
{renderInteractiveSpeed()}
|
{renderInteractiveSpeed()}
|
||||||
<URLField
|
<URLField
|
||||||
|
|||||||
Reference in New Issue
Block a user