Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/whatphilipcodes/fromregs

in-depth configurable version of the stock fromfilename plugin
https://github.com/whatphilipcodes/fromregs

beets-plugin music-library

Last synced: 13 days ago
JSON representation

in-depth configurable version of the stock fromfilename plugin

Awesome Lists containing this project

README

        

# fromregs

Analogous to [fromfilename](https://github.com/beetbox/beets/blob/master/beetsplug/fromfilename.py) but adding the option to configure regex patterns to filter results more precisely.

## Installation

Directly inject from this repository:

```shell
pipx inject beets git+https://github.com/whatphilipcodes/fromregs
```

Then add the plugin to your config:

```yaml
plugins: fromregs [...]
```

## Configuration

The following config replicates the default settings:

```yaml
fromregs:
custom_matchlist:
[
'^(?P.+)[\-_](?P.+)[\-_](?P.*)$',
'^(?P\d+)[\s.\-_]+(?P.+)[\-_](?P.+)[\-_](?P.*)$',
'^(?P.+)[\-_](?P.+)$',
'^(?P\d+)[\s.\-_]+(?P.+)[\-_](?P.+)$',
'^(?P\d+)[\s.\-_]+(?P.+)$',
'^(?P\d+)\s+(?P.+)$',
"^(?P.+) by (?P.+)$",
'^(?P\d+).*$',
"^(?P.+)$",
]
bad_title_matchlist: ["^$"]
artist_post_sub: ['\s{2,}']
title_post_sub: ['\[.*?\]', '\s{2,}']
final_strip: yes
fill_album_from_title: no,
limit_tracknumber: 25,
```

If you are trying to come up with your own regex patterns this plugin delivers more detailed logs when running verbose at level 2:
```bash
beet -vv import path/to/track(s)
```

## Reference

`custom matchlist`

Works via the capture groups `` (album or track artist), `` (track number) and `` (album or track title). The `` capture group is only used when importing more than one track as an album. This field cannot be an emtpy list!

`bad_title_matchlist`

Used to determine if a track is processed (matches the list) or is skipped entirely. This field cannot be an emtpy list!

`artist_post_sub`

Removes parts of the artist result that match with this list as a post-processing step.

`title_post_sub`

Removes parts of the title result that match with this list as a post-processing step.

`final_strip`

If true, removes excess white space on all results individually as the last step before applying the results.

`fill_album_from_title`

Uses the title as album, if that matches your search strategy.

`limit_tracknumber`

Threshold to decide wether a number should be treated as a track or only used for album, artist and title names.