stash/pkg/manager/paths/paths.go

44 lines
830 B
Go
Raw Normal View History

2019-02-09 12:30:49 +00:00
package paths
import (
"path/filepath"
2020-09-15 07:28:53 +00:00
"github.com/stashapp/stash/pkg/utils"
2019-02-09 12:30:49 +00:00
)
type Paths struct {
Generated *generatedPaths
2019-02-09 12:30:49 +00:00
Scene *scenePaths
2019-02-09 12:30:49 +00:00
SceneMarkers *sceneMarkerPaths
}
func NewPaths() *Paths {
2019-02-09 12:30:49 +00:00
p := Paths{}
p.Generated = newGeneratedPaths()
2019-02-09 12:30:49 +00:00
p.Scene = newScenePaths(p)
p.SceneMarkers = newSceneMarkerPaths(p)
return &p
}
func GetConfigDirectory() string {
return filepath.Join(utils.GetHomeDirectory(), ".stash")
}
func GetDefaultDatabaseFilePath() string {
return filepath.Join(GetConfigDirectory(), "stash-go.sqlite")
}
func GetDefaultConfigFilePath() string {
return filepath.Join(GetConfigDirectory(), "config.yml")
}
func GetSSLKey() string {
return filepath.Join(GetConfigDirectory(), "stash.key")
}
func GetSSLCert() string {
return filepath.Join(GetConfigDirectory(), "stash.crt")
}