beetbox / beetbox/beets

`beet ls` regex queries do not match individual values in multi-valued `genres`

Open
#6,961 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

With Beets 2.13.1, regex queries on the multi-valued genres field do not appear to match individual values.

For example, I have tracks with:
```
genres: Electro; Electroclash; Synth-pop
```

The field is correctly populated and displayed:
```
$ beet ls -f '$artist - $title :: $genres' | grep Kittin
Miss Kittin & The Hacker - Life On MTV :: Electro; Electroclash; Synth-pop
Miss Kittin & The Hacker - Frank Sinatra :: Electro; Electroclash; Synth-pop
```

However, a regex matching an individual genre returns no results:
```
$ beet ls 'genres::^Electro$'
```
No output.

```
beet ls 'genres::(^|; )Electro(; |$)'
```
Also outputs nothing.

### Setup
Debian 13
Python 3.13.5
Beets 2.13.1
Bash

The `genres` field is populated with the Discogs plugin.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two `beet ls` regex queries against a library containing the shown multi-valued `genres` values, then trace how the CLI query is applied to individual values. Done means regex matching works for an individual genre and regression coverage verifies both example queries.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.