stash/pkg/manager/paths/paths_json.go

46 lines
1.2 KiB
Go
Raw Normal View History

2019-02-09 12:30:49 +00:00
package paths
import (
"github.com/stashapp/stash/pkg/manager/config"
2019-02-09 12:30:49 +00:00
"path/filepath"
)
type jsonPaths struct {
MappingsFile string
ScrapedFile string
Performers string
Scenes string
Galleries string
Studios string
Movies string
2019-02-09 12:30:49 +00:00
}
func newJSONPaths() *jsonPaths {
2019-02-09 12:30:49 +00:00
jp := jsonPaths{}
jp.MappingsFile = filepath.Join(config.GetMetadataPath(), "mappings.json")
jp.ScrapedFile = filepath.Join(config.GetMetadataPath(), "scraped.json")
jp.Performers = filepath.Join(config.GetMetadataPath(), "performers")
jp.Scenes = filepath.Join(config.GetMetadataPath(), "scenes")
jp.Galleries = filepath.Join(config.GetMetadataPath(), "galleries")
jp.Studios = filepath.Join(config.GetMetadataPath(), "studios")
jp.Movies = filepath.Join(config.GetMetadataPath(), "movies")
2019-02-09 12:30:49 +00:00
return &jp
}
func (jp *jsonPaths) PerformerJSONPath(checksum string) string {
return filepath.Join(jp.Performers, checksum+".json")
2019-02-09 12:30:49 +00:00
}
func (jp *jsonPaths) SceneJSONPath(checksum string) string {
return filepath.Join(jp.Scenes, checksum+".json")
2019-02-09 12:30:49 +00:00
}
func (jp *jsonPaths) StudioJSONPath(checksum string) string {
return filepath.Join(jp.Studios, checksum+".json")
2019-02-09 12:30:49 +00:00
}
func (jp *jsonPaths) MovieJSONPath(checksum string) string {
return filepath.Join(jp.Movies, checksum+".json")
}