beetbox / beetbox/beets

fromfilename: Add filename matching regex for more forms of leading numerals

Open
#541 1 comment 0 reactions 1 assignee Claimed by @henry-oberholtzer View on GitHub
feature fromfilename
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

At in issue #538 sampsyo suggested, I open a new ticket for asking to add a regex implementation in order for the FromFileName plugin do "understand" leading numeration in filenames.

Many users have files sorted with leading numeration, i.e.:

```
01 - Song name.mp3
01.-.Song.name.mp3
01-Song name.mp3
```

et similia.

This lowers A LOT the similarity in beets.

I think adding a regex could help this.

Something like:

```
^[0-9][0-9]*([:punct:]|[:space:])*
```

or even more simple

```
^[0-9][0-9]*[ ,\-=_.]*
```

could remove this problem.

Don't know if Python know these expressions:

```
[:punct:] = [!"#$%&'()*+, \-./:;<=>?@ [\\\]^_`{|}~]
[:space:] = [ \t\r\n\v\f]
```

I am unable to add this to the code, don't know Python :-(

Could someone think at adding something similar?

Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.