New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it Possible to Query Beets by File Type? #2610

Closed
Stunner opened this Issue Jun 22, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@Stunner
Contributor

Stunner commented Jun 22, 2017

As the title says, I am wondering if I can search beets by file type (so that I can pinpoint which artists need to be reimported in order to convert them to a desired format).

@sampsyo

This comment has been minimized.

Member

sampsyo commented Jun 22, 2017

Sure can!

beet ls format:MP3

@sampsyo sampsyo closed this Jun 22, 2017

@Vesnyx

This comment has been minimized.

Vesnyx commented Aug 28, 2017

An addendum to this question. Is there a way to list the albums that contain a certain file format? I'd like to use a command like beet ls -a format:FLAC, but unfortunately this doesn't work. Is there a way to have it display like this or would I need to write a plugin to do so?

@sampsyo

This comment has been minimized.

Member

sampsyo commented Aug 28, 2017

Good point. We don't have an album-level $format field because albums can have multiple formats, but it's possible to define one using the inline plugin and a little bit of Python. I know this has even been discussed before—I was unable to find it quickly, but the answer may be in the issue tracker or the mailing list archives. In any case, the precise incantation will look pretty similar to the "album-level bitrate" example we have in the docs for the inline plugin.

@Vesnyx

This comment has been minimized.

Vesnyx commented Aug 28, 2017

If anyone else is looking for something like this, here's what I used in the inline plugin config, and it seems to work properly for me.

album_fields:
    format: |
        formatList = []
        for item in items:
            formatList.append(item.format)
        return formatList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment