mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Added an onboarding flow
This commit is contained in:
@@ -2,7 +2,6 @@ package paths
|
||||
|
||||
import (
|
||||
"github.com/stashapp/stash/manager/jsonschema"
|
||||
"github.com/stashapp/stash/utils"
|
||||
)
|
||||
|
||||
type Paths struct {
|
||||
@@ -15,14 +14,9 @@ type Paths struct {
|
||||
SceneMarkers *sceneMarkerPaths
|
||||
}
|
||||
|
||||
func RefreshPaths() *Paths {
|
||||
ensureConfigFile()
|
||||
return newPaths()
|
||||
}
|
||||
|
||||
func newPaths() *Paths {
|
||||
func NewPaths(config *jsonschema.Config) *Paths {
|
||||
p := Paths{}
|
||||
p.Config = jsonschema.LoadConfigFile(StaticPaths.ConfigFile)
|
||||
p.Config = config
|
||||
p.Generated = newGeneratedPaths(p)
|
||||
p.JSON = newJSONPaths(p)
|
||||
|
||||
@@ -30,13 +24,4 @@ func newPaths() *Paths {
|
||||
p.Scene = newScenePaths(p)
|
||||
p.SceneMarkers = newSceneMarkerPaths(p)
|
||||
return &p
|
||||
}
|
||||
|
||||
func ensureConfigFile() {
|
||||
configFileExists, _ := utils.FileExists(StaticPaths.ConfigFile) // TODO: Verify JSON is correct. Pass verified
|
||||
if configFileExists {
|
||||
return
|
||||
}
|
||||
|
||||
panic("No config file found")
|
||||
}
|
||||
Reference in New Issue
Block a user