Beet ls path:/foo/bar not returning all results

beets version 1.6.1
Python version 3.11.5

Hello,

Some background for the issue. My music collection is separated into 3 categories: Artists, Composers & Scores. My Directory structure reflects the categories. Years ago I accomplished this by using 3 separate beets configs, one for each category. I always thought this was convoluted so I dug into the doc looking for a more sane approach - Using flexible attributes appears to be what I was looking for.

The relevant part of my config now looks like:

library: /mnt/TARS/Media/library.db
directory: /mnt/TARS/Media/Music
paths:
    default: Artists/%the{$albumartist}/$year - $album%aunique{}/%if{$multidisc,Disc $disc/}$track - $title
    category:artists: Artists/%the{$albumartist}/$year - $album%aunique{}/%if{$multidisc,Disc $disc/}$track - $title
    category:composers: Composers/%asciify{$albumartist}/$year - %asciify{$album%aunique{}}/%if{$multidisc,Disc $disc/}%asciify{$track - $title}
    category:scores: Scores/%the{$albumartist}/$year - $album%aunique{}/%if{$multidisc,Disc $disc/}$track - $title

I first tried to tag all the files in each category by doing:

beet modify category="artists" path:/mnt/TARS/Media/Music/Artists
beet modify category="composers" path:/mnt/TARS/Media/Music/Composers
beet modify category="scores" path:/mnt/TARS/Media/Music/Scores

But this was not finding any files. To be sure:

beet ls path:/mnt/TARS/Media/Music/Artists

would not return anything.

By a happy accident typo I noticed prepending path:: to the filepath instead of path: would return all the files. I know the double :: is for regex, but not sure why this finds the files when the single : does not.

Perhaps wrecklessly, I ran the beet modify category="foobar" path::/foo/bar for each category and everything looks correct, e.g, beet ls category:artists | wc -l return the expected count of files, 24878

So that’s the background, this is the issue I cannot figure out - Running:

beet ls path:/mnt/TARS/Media/Music/Artists | wc -l

returns 5871, the correct count being 24878. I expected it to find either none, like the above issue or hopefully 24878 after having run the modify command

Using the path::/foo/bar regex returns the correct count. The same issue happens on each category, eg, scores, composers.

Do any of have an idea what could be going on here? Obviously there is something not right with the database, but I am at a loss. Any ideas would be very appreciated!

Solved. Was a database issue

1 Like