Replace empty path components by default
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 31
Description
Currently, if a path template becomes empty, it can result in confusing directory hierarchies. For example, if you use the path template:
```
$albumartist/$album/$title
```
and a track has a missing album, then the audio file is placed in the _artist's_ directory (i.e., since $album is empty, the path is `artist//title.mp3`, which is equivalent to `artist/title.mp3`).
The function `util.sanitize_path` should permit the replacements configuration to detect these empty path components with the regex `^$` and replace them with something sensible like `_`. The default replacements should be extended to enable this.
Currently, `ancestry` (and, by extension, `components`) drops these empty components.
Contributor guide
Assessment
This issue has not been assessed yet.