-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
%ifdef does not work on flexattr fields with int or float #3852
Labels
bug
bugs that are confirmed and actionable
Comments
Thanks! The right fix here is to change the |
I'm also facing this issue and glad to know it can be fixed. I thought it was my own user error though. |
Hello, I would like to work on this bug. |
adsultana
added a commit
to adsultana/beets
that referenced
this issue
Jun 16, 2021
… missing values
3 tasks
sampsyo
added a commit
that referenced
this issue
Jun 17, 2021
Fix ifdef behavior with non-string fields (bug #3852)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
If I try
beet ls -a -f '$albumartist - (%if{$original_year,$original_year,$year}) - $album%ifdef{albumdisambig, (%title{$albumdisambig}),}%ifdef{albumrating, ($albumrating),}' year:2021
then beets will return the album rating for the albums that has the field defined. For albums without the rating,$albumrating
is returned.Example:
Further information on the forum:
https://discourse.beets.io/t/album-rating-as-a-flexible-attribute-in-5-increments/1687/3
Comment from adrian:
reading over the implementation of %ifdef, I can see now how it would be confused about types with a default value. That is, int or float fields will produce a '0' string for unset values through the formatter, which gets interpreted as non-missing. We clearly need better logic for this.
Setup
The text was updated successfully, but these errors were encountered: