mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 16:34:02 +01:00
* Make config instance-based * Remove config dependency in paths * Refactor config init * Allow startup without database * Get system status at UI initialise * Add setup wizard * Cache and Metadata optional. Database mandatory * Handle metadata not set during full import/export * Add links * Remove config check middleware * Stash not mandatory * Panic on missing mandatory config fields * Redirect setup to main page if setup not required * Add migration UI * Remove unused stuff * Move UI initialisation into App * Don't create metadata paths on RefreshConfig * Add folder selector for generated in setup * Env variable to set and create config file. Make docker images use a fixed config file. * Set config file during setup
34 lines
900 B
Go
34 lines
900 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"strconv"
|
|
|
|
"github.com/stashapp/stash/pkg/api/urlbuilders"
|
|
"github.com/stashapp/stash/pkg/manager"
|
|
"github.com/stashapp/stash/pkg/manager/config"
|
|
"github.com/stashapp/stash/pkg/models"
|
|
)
|
|
|
|
func (r *queryResolver) SceneStreams(ctx context.Context, id *string) ([]*models.SceneStreamEndpoint, error) {
|
|
// find the scene
|
|
var scene *models.Scene
|
|
if err := r.withReadTxn(ctx, func(repo models.ReaderRepository) error {
|
|
idInt, _ := strconv.Atoi(*id)
|
|
var err error
|
|
scene, err = repo.Scene().Find(idInt)
|
|
return err
|
|
}); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if scene == nil {
|
|
return nil, errors.New("nil scene")
|
|
}
|
|
|
|
baseURL, _ := ctx.Value(BaseURLCtxKey).(string)
|
|
builder := urlbuilders.NewSceneURLBuilder(baseURL, scene.ID)
|
|
|
|
return manager.GetSceneStreamPaths(scene, builder.GetStreamURL(), config.GetInstance().GetMaxStreamingTranscodeSize())
|
|
}
|