This commit is contained in:
Stash Dev
2019-02-14 15:42:52 -08:00
parent 1d00b2b36f
commit b488c1ed7d
111 changed files with 141 additions and 141 deletions

View File

@@ -0,0 +1,40 @@
package paths
import (
"github.com/stashapp/stash/pkg/utils"
"path/filepath"
)
type generatedPaths struct {
Screenshots string
Vtt string
Markers string
Transcodes string
Tmp string
}
func newGeneratedPaths(p Paths) *generatedPaths {
gp := generatedPaths{}
gp.Screenshots = filepath.Join(p.Config.Metadata, "screenshots")
gp.Vtt = filepath.Join(p.Config.Metadata, "vtt")
gp.Markers = filepath.Join(p.Config.Metadata, "markers")
gp.Transcodes = filepath.Join(p.Config.Metadata, "transcodes")
gp.Tmp = filepath.Join(p.Config.Metadata, "tmp")
return &gp
}
func (gp *generatedPaths) GetTmpPath(fileName string) string {
return filepath.Join(gp.Tmp, fileName)
}
func (gp *generatedPaths) EnsureTmpDir() {
_ = utils.EnsureDir(gp.Tmp)
}
func (gp *generatedPaths) EmptyTmpDir() {
_ = utils.EmptyDir(gp.Tmp)
}
func (gp *generatedPaths) RemoveTmpDir() {
_ = utils.RemoveDir(gp.Tmp)
}