YAML Configuration Refactor
This commit is contained in:
@@ -739,7 +739,13 @@ func musicPrefixForDir(p *project.Project, dir string) string {
|
||||
dir = trimSlashes(filepath.ToSlash(dir))
|
||||
bestPrefix := ""
|
||||
bestLen := -1
|
||||
for key, value := range p.Config.Music.Prefixes {
|
||||
keys := make([]string, 0, len(p.Config.Music.Prefixes))
|
||||
for key := range p.Config.Music.Prefixes {
|
||||
keys = append(keys, key)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
for _, key := range keys {
|
||||
value := p.Config.Music.Prefixes[key]
|
||||
normalizedKey := trimSlashes(filepath.ToSlash(key))
|
||||
if normalizedKey == "" {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user