Send a placeholder for markers which haven't been generated yet

This commit is contained in:
Stash Dev
2019-06-01 09:48:28 -07:00
parent 551e436c57
commit 73f0d7d399
2 changed files with 13 additions and 0 deletions

View File

@@ -121,6 +121,16 @@ func (rs sceneRoutes) SceneMarkerPreview(w http.ResponseWriter, r *http.Request)
return
}
filepath := manager.GetInstance().Paths.SceneMarkers.GetStreamPreviewImagePath(scene.Checksum, int(sceneMarker.Seconds))
// If the image doesn't exist, send the placeholder
exists, _ := utils.FileExists(filepath)
if !exists {
w.Header().Set("Content-Type", "image/png")
w.Header().Set("Cache-Control", "no-store")
_, _ = w.Write(utils.PendingGenerateResource)
return
}
http.ServeFile(w, r, filepath)
}