# Using bitrate\_mode in beet list

**URL:** <https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106>\
**Category:** Help\
**Created:** [June 15, 2022, 3:24am UTC](https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106 "2022-06-15T03:24:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellige](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/hellige/32/654_2.png) [@hellige](https://discourse.beets.io/u/hellige)\
**Post date:** [June 15, 2022, 3:24am UTC](https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106/1 "2022-06-15T03:24:53Z")

</div>

I can do `beet ls -f '${bitrate}` and get the output I expect, a list of all the bitrates in the library. But when I do `beet ls -f '${bitrate_mode}`, I just get a long list of literal `${bitrate_mode}` as output. Why? Is this expected? Is it a bug? I’m using beets 1.6.0. Thanks for any help or ideas!!

---

<div class="post-metadata">

**Author:** ![jackwilsdon](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jackwilsdon/32/10_2.png) [@jackwilsdon](https://discourse.beets.io/u/jackwilsdon)\
**Post date:** [June 15, 2022, 7:11am UTC](https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106/2 "2022-06-15T07:11:19Z")

</div>

What version of beets are you on? `bitrate_mode` is only available on the development branch at the moment, a release containing it hasn’t been pushed out yet.

See the [FAQ on running the latest source version](https://beets.readthedocs.io/en/stable/faq.html#run-the-latest-source-version-of-beets) for instructions on how to try this version out (be sure to keep a backup of your library!).

---

<div class="post-metadata">

**Author:** ![hellige](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/hellige/32/654_2.png) [@hellige](https://discourse.beets.io/u/hellige)\
**Post date:** [June 16, 2022, 11:39pm UTC](https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106/3 "2022-06-16T23:39:05Z")

</div>

I see! I found the field using the `info` plugin. I didn’t realize it wasn’t necessarily possible to query on all those fields. I see now that the field is _not_ listed in the output of `beet fields`. So, the basic rule is that you can only query based on the officially supported fields, even if the file itself contains other tags? Is there a way to fall back on a full scan of the library for a particular tag?

Thanks for the reply, this already gave me a better understanding of the beets approach!

---

<div class="post-metadata">

**Author:** ![jackwilsdon](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/jackwilsdon/32/10_2.png) [@jackwilsdon](https://discourse.beets.io/u/jackwilsdon)\
**Post date:** [June 17, 2022, 2:04pm UTC](https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106/4 "2022-06-17T14:04:02Z")

</div>

I agree it’s not obvious that you can’t query using all fields output by `beet info`.

For some context, the reason behind this is that the `info` command without `-l` or `-a` uses raw file tags (provided by [`mediafile`](https://github.com/beetbox/mediafile)) instead of pulling them from the beets database, but queries can only be performed on fields present in the database (which `bitrate_mode` will be in the next release).

If you use `beet info -l` or `beet info -a` it will display data from the database instead of from the audio files themselves - you _should_ be able to query using all of these fields.

---

<div class="post-metadata">

**Author:** ![hellige](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/hellige/32/654_2.png) [@hellige](https://discourse.beets.io/u/hellige)\
**Post date:** [June 17, 2022, 2:34pm UTC](https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106/5 "2022-06-17T14:34:06Z")

</div>

Makes sense. It seems like it might be nice to have a flag or a separate command that actually _does_ support doing a full library scan. Of course it could take a long time, but the only alternative is to scrape the tags yourself and do a grep/awk thing, which is certainly going to take just as long!

---

<div class="post-metadata">

**Author:** ![RollingStar](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/rollingstar/32/728_2.png) [@RollingStar](https://discourse.beets.io/u/RollingStar)\
**Post date:** [July 6, 2022, 3:00pm UTC](https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106/6 "2022-07-06T15:00:39Z")

</div>

To tease out the implication, based on this thread (not my own knowledge):

`beet ls` uses the beets database. This uses a technology called [SQL](https://en.wikipedia.org/wiki/SQL), which is able to create results very fast.

`beet info` “without `-l` or `-a` uses raw file tags”. That means the beet program is going file by file on your drive, opening the part of the file that has tags, and returning the info you asked for. This is significantly slower, because there is a lot of info the program has to look through and toss out before it finds the info you need.

---

<div class="post-metadata">

**Author:** ![hellige](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/hellige/32/654_2.png) [@hellige](https://discourse.beets.io/u/hellige)\
**Post date:** [July 6, 2022, 10:16pm UTC](https://discourse.beets.io/t/using-bitrate-mode-in-beet-list/2106/7 "2022-07-06T22:16:04Z")

</div>

That seems to be correct.

As a side note, it’s still surprising to me that there’s no way to coax `beet ls` to even use file tags when you format the output. I can understand not supporting queries against the raw files, but once you’ve selected the things to display, it would be nice if there were a way to include those tags in the formatted output.
