Rename Config.GetExportPath() to ExportPath(), see #50

This commit is contained in:
Michael Mayer 2018-12-21 03:22:25 +01:00
parent 1a4815fd51
commit 32444bde18
7 changed files with 13 additions and 12 deletions

View file

@ -23,7 +23,7 @@ func configAction(ctx *cli.Context) error {
fmt.Printf("darktable-cli %s\n", conf.GetDarktableCli())
fmt.Printf("originals-path %s\n", conf.OriginalsPath())
fmt.Printf("import-path %s\n", conf.ImportPath())
fmt.Printf("export-path %s\n", conf.GetExportPath())
fmt.Printf("export-path %s\n", conf.ExportPath())
fmt.Printf("cache-path %s\n", conf.GetCachePath())
fmt.Printf("assets-path %s\n", conf.GetAssetsPath())
fmt.Printf("database-driver %s\n", conf.DatabaseDriver())

View file

@ -69,7 +69,7 @@ func exportAction(ctx *cli.Context) error {
}
}
exportPath := fmt.Sprintf("%s/%s", conf.GetExportPath(), name)
exportPath := fmt.Sprintf("%s/%s", conf.ExportPath(), name)
size := ctx.Int("size")
originals := photoprism.FindOriginalsByDate(conf.OriginalsPath(), afterDate, beforeDate)

View file

@ -221,7 +221,7 @@ func (c *Config) CreateDirectories() error {
return err
}
if err := os.MkdirAll(c.GetExportPath(), os.ModePerm); err != nil {
if err := os.MkdirAll(c.ExportPath(), os.ModePerm); err != nil {
return err
}
@ -356,8 +356,8 @@ func (c *Config) ImportPath() string {
return c.importPath
}
// GetExportPath returns the export directory.
func (c *Config) GetExportPath() string {
// ExportPath returns the export directory.
func (c *Config) ExportPath() string {
return c.exportPath
}

View file

@ -33,7 +33,7 @@ func TestConfig_SetValuesFromFile(t *testing.T) {
assert.Equal(t, "/srv/photoprism/cache/thumbnails", c.GetThumbnailsPath())
assert.Equal(t, "/srv/photoprism/photos/originals", c.OriginalsPath())
assert.Equal(t, "/srv/photoprism/photos/import", c.ImportPath())
assert.Equal(t, "/srv/photoprism/photos/export", c.GetExportPath())
assert.Equal(t, "/srv/photoprism/photos/export", c.ExportPath())
assert.Equal(t, "tidb", c.DatabaseDriver())
assert.Equal(t, "root:@tcp(localhost:4000)/photoprism?parseTime=true", c.DatabaseDsn())
}

View file

@ -34,7 +34,8 @@ type Config interface {
OriginalsPath() string
ImportPath() string
GetExportPath() string
ExportPath() string
GetDarktableCli() string
GetCachePath() string
GetThumbnailsPath() string

View file

@ -57,7 +57,7 @@ func TestContextConfig_SetValuesFromFile(t *testing.T) {
assert.Equal(t, "/srv/photoprism/cache/thumbnails", c.GetThumbnailsPath())
assert.Equal(t, "/srv/photoprism/photos/originals", c.OriginalsPath())
assert.Equal(t, "/srv/photoprism/photos/import", c.ImportPath())
assert.Equal(t, "/srv/photoprism/photos/export", c.GetExportPath())
assert.Equal(t, "/srv/photoprism/photos/export", c.ExportPath())
assert.Equal(t, "tidb", c.DatabaseDriver())
assert.Equal(t, "root:@tcp(localhost:4000)/photoprism?parseTime=true", c.DatabaseDsn())
}

View file

@ -43,7 +43,7 @@ type Config struct {
func (c *Config) RemoveTestData(t *testing.T) {
os.RemoveAll(c.ImportPath())
os.RemoveAll(c.GetExportPath())
os.RemoveAll(c.ExportPath())
os.RemoveAll(c.OriginalsPath())
os.RemoveAll(c.GetCachePath())
}
@ -101,7 +101,7 @@ func (c *Config) CreateDirectories() error {
return err
}
if err := os.MkdirAll(c.GetExportPath(), os.ModePerm); err != nil {
if err := os.MkdirAll(c.ExportPath(), os.ModePerm); err != nil {
return err
}
@ -213,8 +213,8 @@ func (c *Config) ImportPath() string {
return ImportPath
}
// GetExportPath returns the export directory.
func (c *Config) GetExportPath() string {
// ExportPath returns the export directory.
func (c *Config) ExportPath() string {
return ExportPath
}