Rename Config.GetAssetsPath() to AssetsPath(), see #50
This commit is contained in:
parent
628c598f08
commit
7fde545fe7
7 changed files with 18 additions and 18 deletions
|
@ -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())
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue