# How to list all hires FLACs in collection?

**URL:** https://discourse.beets.io/t/how-to-list-all-hires-flacs-in-collection/646
**Category:** Help
**Created:** [February 27, 2019, 1:29pm UTC](https://discourse.beets.io/t/how-to-list-all-hires-flacs-in-collection/646 "2019-02-27T13:29:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![janpeeters](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/janpeeters/32/182_2.png) [@janpeeters](https://discourse.beets.io/u/janpeeters)
#### Post date: [February 27, 2019, 1:29pm UTC](https://discourse.beets.io/t/how-to-list-all-hires-flacs-in-collection/646/1 "2019-02-27T13:29:17Z")

</div>

I’m trying to list all my hires FLACs in my collection. Since hires FLACs seem to always be 24bit I tried the following:

`beet ls -af '$bitdepth/$my_samplerate $albumartist - $album' format:FLAC bitdepth:24`

To get an easily readable output like this:

`24/48 alt-J - An Awesome Wave`

But it doesn’t work. What am I missing?  
I use the following inline plugin settings in config:

```
# Inline plugin template
item_fields:
  multidisc: 1 if disctotal > 1 else 0
  my_samplerate: round(samplerate / 1000)
  is_flac: 1 if format == "FLAC" else 0
album_fields:  
  format: |
       formatList = []
       for item in items:
           formatList.append(item.format)
       return formatList
  av_bitrate: |
       total = 0
       for item in items:
           total += item.bitrate
       return round(total / len(items) / 1000)

```

Under Types (in my config) I’ve set

```
    av_bitrate: int
    my_samplerate: int
    bitdepth: int
```

---

<div class="post-metadata">

### Author: ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)
#### Post date: [February 27, 2019, 2:18pm UTC](https://discourse.beets.io/t/how-to-list-all-hires-flacs-in-collection/646/2 "2019-02-27T14:18:52Z")

</div>

Hi! One problem here is that you’re querying albums (`-a`), but $bitdepth is a track-level field (and not an album-level field). You could consider playing the same trick as with $format to get an album-level version.

---

<div class="post-metadata">

### Author: ![janpeeters](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/janpeeters/32/182_2.png) [@janpeeters](https://discourse.beets.io/u/janpeeters)
#### Post date: [February 27, 2019, 6:52pm UTC](https://discourse.beets.io/t/how-to-list-all-hires-flacs-in-collection/646/3 "2019-02-27T18:52:12Z")

</div>

Thanks for pointing me in the right direction @adrian.

The solution I found is as follows…  
I added two album level fields in the inline plugin section of my config:  
`album_bitdepth` and `album_samplerate`

```
# Inline plugin template
item_fields:
  multidisc: 1 if disctotal > 1 else 0
  my_samplerate: round(samplerate / 1000)
  is_flac: 1 if format == "FLAC" else 0
album_fields:  
  format: |
       formatList = []
       for item in items:
           formatList.append(item.format)
       return formatList
  av_bitrate: |
       total = 0
       for item in items:
           total += item.bitrate
       return round(total / len(items) / 1000)
  album_bitdepth: |
       total = 0
       for item in items:
           total += item.bitdepth
       return round(total / len(items))
  album_samplerate: |
       total = 0
       for item in items:
           total += item.samplerate
       return round(total / len(items) / 1000)

```

And my query as follows:

`beet ls -af '$album_bitdepth/$album_samplerate $albumartist - $album ($original_year)' format:flac album_bitdepth:24..`

This gives me a listing like this:

```
24/96 Frank Zappa & The Mothers of Invention - At Fillmore East (2011)
24/96 The Allman Brothers Band - At Fillmore East (2011)
24/96 alt-J - An Awesome Wave (2012)
24/44 alt-J - Relaxer (2017)
24/44 alt-J - This Is All Yours (2014)
24/44 Aphex Twin - Computer Controlled Acoustic Instruments, Part 2 (2015)
24/44 Fiona Apple - The Idler Wheel Is Wiser Than the Driver of the Screw and Whipping Cords Will Serve You More Than Ropes Will Ever Do (2012)
24/44 Ólafur Arnalds - For Now I Am Winter (2013)

```

🙂
