beetbox / beetbox/beets

The computed `albumtotal` field should have numeric type

Open
#2,693 3 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

### Problem

When using `albumtotal` in a query, numeric ranges are not supported:

```sh
$ beet list -a -f '$album: $albumtotal' albumtotal:26 Petra
The Praise Collection: 26

$ beet list -a -f '$album: $albumtotal' albumtotal:23..28 Petra
(no output)
```

I would expect these two commands to give the same result.

### Setup

beets version 1.4.5
Python version 3.6.2
plugins: discogs, duplicates, embedart, fetchart, lastgenre, lyrics, missing, web

My configuration (output of `beet config`) is:

```yaml
lyrics:
bing_lang_from: []
auto: yes
bing_client_secret: REDACTED
bing_lang_to:
google_API_key: REDACTED
google_engine_ID: REDACTED
genius_api_key: REDACTED
fallback:
force: no
sources: [google, lyricwiki, musixmatch]
directory: ~/Music/beet
library: ~/Music/beet.db

plugins:
- discogs
- duplicates
- embedart
- fetchart
- lastgenre
- lyrics
- missing
- web
web:
host: 127.0.0.1
port: 8337
cors: ''
reverse_proxy: no
include_paths: no
duplicates:
album: no
checksum: ''
copy: ''
count: no
delete: no
format: ''
full: no
keys: []
merge: no
move: ''
path: no
tiebreak: {}
strict: no
tag: ''
discogs:
apikey: REDACTED
apisecret: REDACTED
tokenfile: discogs_token.json
source_weight: 0.5
user_token: REDACTED
missing:
count: no
total: no
album: no
fetchart:
auto: yes
minwidth: 0
maxwidth: 0
enforce_ratio: no
cautious: no
cover_names:
- cover
- front
- art
- album
- folder
sources:
- filesystem
- coverart
- itunes
- amazon
- albumart
google_key: REDACTED
google_engine: 001442825323518660753:hrh5ch1gjzm
fanarttv_key: REDACTED
store_source: no
embedart:
maxwidth: 0
auto: yes
compare_threshold: 0
ifempty: no
remove_art_file: no
lastgenre:
whitelist: yes
min_weight: 10
count: 1
fallback:
canonical: no
source: album
force: yes
auto: yes
separator: ', '
prefer_specific: no
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two `beet list` commands from the report and inspect the query handling for the computed `albumtotal` field. Confirm that exact-value and numeric-range queries return the same album, then add or update coverage for both forms if the relevant tests are found.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.