diff --git a/app/app.go b/app/app.go index 69811eb..37114b2 100644 --- a/app/app.go +++ b/app/app.go @@ -146,6 +146,7 @@ func NewApp(cfg *Config) (*App, error) { // Run imports the library and starts server. func (a *App) Run() error { for _, pc := range a.Config.Library { + pc.Path = filepath.Clean(pc.Path) p := &media.Path{ Path: pc.Path, Prefix: pc.Prefix, diff --git a/media/library.go b/media/library.go index 7de68e0..0657847 100644 --- a/media/library.go +++ b/media/library.go @@ -35,10 +35,10 @@ func (lib *Library) AddPath(p *Path) error { // make sure new path doesn't collide with existing ones for _, p2 := range lib.Paths { if p.Path == p2.Path { - return errors.New("media: duplicate library path") + return errors.New(fmt.Sprintf("media: duplicate (normalized) library path '%s'", p.Path)) } if p.Prefix == p2.Prefix { - return errors.New("media: duplicate library prefix") + return errors.New(fmt.Sprintf("media: duplicate library prefix '%s'", p.Prefix)) } } if err := os.MkdirAll(p.Path, 0755); err != nil {