2019-02-09 12:30:49 +00:00
|
|
|
package paths
|
|
|
|
|
|
|
|
import (
|
2019-03-23 21:09:05 +00:00
|
|
|
"github.com/stashapp/stash/pkg/utils"
|
2019-03-23 14:56:59 +00:00
|
|
|
"path/filepath"
|
2019-02-09 12:30:49 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Paths struct {
|
2019-02-14 22:53:32 +00:00
|
|
|
Generated *generatedPaths
|
|
|
|
JSON *jsonPaths
|
2019-02-09 12:30:49 +00:00
|
|
|
|
2019-02-14 22:53:32 +00:00
|
|
|
Gallery *galleryPaths
|
|
|
|
Scene *scenePaths
|
2019-02-09 12:30:49 +00:00
|
|
|
SceneMarkers *sceneMarkerPaths
|
|
|
|
}
|
|
|
|
|
2019-03-23 14:56:59 +00:00
|
|
|
func NewPaths() *Paths {
|
2019-02-09 12:30:49 +00:00
|
|
|
p := Paths{}
|
2019-03-23 14:56:59 +00:00
|
|
|
p.Generated = newGeneratedPaths()
|
|
|
|
p.JSON = newJSONPaths()
|
2019-02-09 12:30:49 +00:00
|
|
|
|
2019-03-23 14:56:59 +00:00
|
|
|
p.Gallery = newGalleryPaths()
|
2019-02-09 12:30:49 +00:00
|
|
|
p.Scene = newScenePaths(p)
|
|
|
|
p.SceneMarkers = newSceneMarkerPaths(p)
|
|
|
|
return &p
|
2019-02-14 22:53:32 +00:00
|
|
|
}
|
2019-03-23 14:56:59 +00:00
|
|
|
|
|
|
|
func GetConfigDirectory() string {
|
2019-03-23 21:09:05 +00:00
|
|
|
return filepath.Join(utils.GetHomeDirectory(), ".stash")
|
2019-03-23 14:56:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func GetDefaultDatabaseFilePath() string {
|
|
|
|
return filepath.Join(GetConfigDirectory(), "stash-go.sqlite")
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetDefaultConfigFilePath() string {
|
|
|
|
return filepath.Join(GetConfigDirectory(), "config.yml")
|
|
|
|
}
|
2019-04-11 17:55:58 +00:00
|
|
|
|
|
|
|
func GetSSLKey() string {
|
|
|
|
return filepath.Join(GetConfigDirectory(), "stash.key")
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetSSLCert() string {
|
|
|
|
return filepath.Join(GetConfigDirectory(), "stash.crt")
|
|
|
|
}
|