mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Allow serving of interactive CSVs directly to Handy (#3756)
* allow direct serve interactive CSVs to Handy --------- Co-authored-by: kermieisinthehouse <kermie@isinthe.house>
This commit is contained in:
@@ -72,6 +72,7 @@ func (rs sceneRoutes) Routes() chi.Router {
|
||||
r.Get("/vtt/thumbs", rs.VttThumbs)
|
||||
r.Get("/vtt/sprite", rs.VttSprite)
|
||||
r.Get("/funscript", rs.Funscript)
|
||||
r.Get("/interactive_csv", rs.InteractiveCSV)
|
||||
r.Get("/interactive_heatmap", rs.InteractiveHeatmap)
|
||||
r.Get("/caption", rs.CaptionLang)
|
||||
|
||||
@@ -374,6 +375,20 @@ func (rs sceneRoutes) Funscript(w http.ResponseWriter, r *http.Request) {
|
||||
utils.ServeStaticFile(w, r, filepath)
|
||||
}
|
||||
|
||||
func (rs sceneRoutes) InteractiveCSV(w http.ResponseWriter, r *http.Request) {
|
||||
s := r.Context().Value(sceneKey).(*models.Scene)
|
||||
filepath := video.GetFunscriptPath(s.Path)
|
||||
|
||||
// TheHandy directly only accepts interactive CSVs
|
||||
csvBytes, err := manager.ConvertFunscriptToCSV(filepath)
|
||||
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
utils.ServeStaticContent(w, r, csvBytes)
|
||||
}
|
||||
|
||||
func (rs sceneRoutes) InteractiveHeatmap(w http.ResponseWriter, r *http.Request) {
|
||||
scene := r.Context().Value(sceneKey).(*models.Scene)
|
||||
sceneHash := scene.GetHash(config.GetInstance().GetVideoFileNamingAlgorithm())
|
||||
|
||||
Reference in New Issue
Block a user