Query non-CD albums

Hi!

I want to list all non-CD albums in my library.

With beet list ^media:cd I get the list of all non-CD tracks. But this doesn’t work with option -a, so beet list -a ^media:cd gives me all the albums in my library (as I understand, media is not an album field?).

How can I get the corresponding albums?

Thanks and regards!

Indeed, media is a track-level field because it’s possible for albums to consist of multiple media (e.g., a CD and a DVD). You could consider defining an album-level equivalent using the inline plugin, like this album-level equivalent of bitrate:
https://beets.readthedocs.io/en/stable/plugins/inline.html#album-fields

…but you’d need to come up with a policy for how to do the mapping (e.g., using the first track or the majority).

@schmeckx How about a shell script?

beet ls ^media:cd -f '$album' | sort -u

This outputs, for each track matching the query, the name of its album, then sorts them, removing duplicates.

If you have multiple albums with the same title, you could also differentiate based on mb_albumid assuming your stuff is tagged from MusicBrainz—but that would be more complicated.

Thanks, that’s what I was looking for (since I just need a quick overview)!

1 Like