Rename Config.GetAssetsPath() to AssetsPath(), see #50

This commit is contained in:
Michael Mayer 2018-12-21 03:25:09 +01:00
parent 628c598f08
commit 7fde545fe7
7 changed files with 18 additions and 18 deletions

View file

@ -25,7 +25,7 @@ func configAction(ctx *cli.Context) error {
fmt.Printf("import-path %s\n", conf.ImportPath())
fmt.Printf("export-path %s\n", conf.ExportPath())
fmt.Printf("cache-path %s\n", conf.CachePath())
fmt.Printf("assets-path %s\n", conf.GetAssetsPath())
fmt.Printf("assets-path %s\n", conf.AssetsPath())
fmt.Printf("database-driver %s\n", conf.DatabaseDriver())
fmt.Printf("database-dsn %s\n", conf.DatabaseDsn())

View file

@ -386,24 +386,24 @@ func (c *Config) ThumbnailsPath() string {
return c.CachePath() + "/thumbnails"
}
// GetAssetsPath returns the path to the assets.
func (c *Config) GetAssetsPath() string {
// AssetsPath returns the path to the assets.
func (c *Config) AssetsPath() string {
return c.assetsPath
}
// GetTensorFlowModelPath returns the tensorflow model path.
func (c *Config) GetTensorFlowModelPath() string {
return c.GetAssetsPath() + "/tensorflow"
return c.AssetsPath() + "/tensorflow"
}
// GetDatabasePath returns the database storage path (e.g. for SQLite or Bleve).
func (c *Config) GetDatabasePath() string {
return c.GetAssetsPath() + "/database"
return c.AssetsPath() + "/database"
}
// GetServerAssetsPath returns the server assets path (public files, favicons, templates,...).
func (c *Config) GetServerAssetsPath() string {
return c.GetAssetsPath() + "/server"
return c.AssetsPath() + "/server"
}
// GetTemplatesPath returns the server templates path.

View file

@ -19,7 +19,7 @@ func TestNewConfig(t *testing.T) {
assert.IsType(t, new(Config), c)
assert.Equal(t, fsutil.ExpandedFilename("../../assets"), c.GetAssetsPath())
assert.Equal(t, fsutil.ExpandedFilename("../../assets"), c.AssetsPath())
assert.False(t, c.Debug())
}
@ -28,7 +28,7 @@ func TestConfig_SetValuesFromFile(t *testing.T) {
c.SetValuesFromFile(fsutil.ExpandedFilename("../../configs/photoprism.yml"))
assert.Equal(t, "/srv/photoprism", c.GetAssetsPath())
assert.Equal(t, "/srv/photoprism", c.AssetsPath())
assert.Equal(t, "/srv/photoprism/cache", c.CachePath())
assert.Equal(t, "/srv/photoprism/cache/thumbnails", c.ThumbnailsPath())
assert.Equal(t, "/srv/photoprism/photos/originals", c.OriginalsPath())

View file

@ -36,10 +36,10 @@ type Config interface {
ImportPath() string
ExportPath() string
CachePath() string
ThumbnailsPath() string
AssetsPath() string
DarktableCli() string
ThumbnailsPath() string
GetAssetsPath() string
GetTensorFlowModelPath() string
GetDatabasePath() string
GetServerAssetsPath() string

View file

@ -43,7 +43,7 @@ func TestNewConfig(t *testing.T) {
assert.IsType(t, new(context.Config), c)
assert.Equal(t, test.AssetsPath, c.GetAssetsPath())
assert.Equal(t, test.AssetsPath, c.AssetsPath())
assert.False(t, c.Debug())
}
@ -52,7 +52,7 @@ func TestContextConfig_SetValuesFromFile(t *testing.T) {
c.SetValuesFromFile(fsutil.ExpandedFilename(test.ConfigFile))
assert.Equal(t, "/srv/photoprism", c.GetAssetsPath())
assert.Equal(t, "/srv/photoprism", c.AssetsPath())
assert.Equal(t, "/srv/photoprism/cache", c.CachePath())
assert.Equal(t, "/srv/photoprism/cache/thumbnails", c.ThumbnailsPath())
assert.Equal(t, "/srv/photoprism/photos/originals", c.OriginalsPath())

View file

@ -243,24 +243,24 @@ func (c *Config) ThumbnailsPath() string {
return c.CachePath() + "/thumbnails"
}
// GetAssetsPath returns the path to the assets.
func (c *Config) GetAssetsPath() string {
// AssetsPath returns the path to the assets.
func (c *Config) AssetsPath() string {
return AssetsPath
}
// GetTensorFlowModelPath returns the tensorflow model path.
func (c *Config) GetTensorFlowModelPath() string {
return c.GetAssetsPath() + "/tensorflow"
return c.AssetsPath() + "/tensorflow"
}
// GetDatabasePath returns the database storage path (e.g. for SQLite or Bleve).
func (c *Config) GetDatabasePath() string {
return c.GetAssetsPath() + "/database"
return c.AssetsPath() + "/database"
}
// GetServerAssetsPath returns the server assets path (public files, favicons, templates,...).
func (c *Config) GetServerAssetsPath() string {
return c.GetAssetsPath() + "/server"
return c.AssetsPath() + "/server"
}
// GetTemplatesPath returns the server templates path.

View file

@ -12,7 +12,7 @@ func TestNewConfig(t *testing.T) {
assert.IsType(t, new(Config), c)
assert.Equal(t, AssetsPath, c.GetAssetsPath())
assert.Equal(t, AssetsPath, c.AssetsPath())
assert.False(t, c.Debug())
}