mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
* Fix relative URLs * Improve login base URL and redirects * Prevent duplicate customlocales requests * Improve UI base URL handling * Improve UI embedding * Improve CSP header * Add Cache-Control headers to all responses * Improve CORS responses * Improve authentication handler * Add back media timestamp suffixes * Fix default image handling * Add default param to other image URLs
33 lines
877 B
Go
33 lines
877 B
Go
package urlbuilders
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
"github.com/stashapp/stash/pkg/models"
|
|
)
|
|
|
|
type SceneMarkerURLBuilder struct {
|
|
BaseURL string
|
|
SceneID string
|
|
MarkerID string
|
|
}
|
|
|
|
func NewSceneMarkerURLBuilder(baseURL string, sceneMarker *models.SceneMarker) SceneMarkerURLBuilder {
|
|
return SceneMarkerURLBuilder{
|
|
BaseURL: baseURL,
|
|
SceneID: strconv.Itoa(int(sceneMarker.SceneID.Int64)),
|
|
MarkerID: strconv.Itoa(sceneMarker.ID),
|
|
}
|
|
}
|
|
|
|
func (b SceneMarkerURLBuilder) GetStreamURL() string {
|
|
return b.BaseURL + "/scene/" + b.SceneID + "/scene_marker/" + b.MarkerID + "/stream"
|
|
}
|
|
|
|
func (b SceneMarkerURLBuilder) GetPreviewURL() string {
|
|
return b.BaseURL + "/scene/" + b.SceneID + "/scene_marker/" + b.MarkerID + "/preview"
|
|
}
|
|
|
|
func (b SceneMarkerURLBuilder) GetScreenshotURL() string {
|
|
return b.BaseURL + "/scene/" + b.SceneID + "/scene_marker/" + b.MarkerID + "/screenshot"
|
|
}
|