-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Template doesn't format at all when contains a comma #2166
Comments
Thanks! This looks like a nasty bug in our template parser. Here's an easy way to see what's wrong:
Curiously, a comma following the field works fine:
|
Following a longer than expected beets-hiatus, I was looking through the recent issues in order to try to slowly get back into active development - and stumbled upon this issue! After looking at the syntax details docs (emphasis mine):
I believe miblodelcarpio's problem (and the other examples on the followup comment) could be fixed by simply escaping the comma?
However, I'm wondering if it would be worth to try to improve the handling of commas in order to reduce confusion: comma ( Would it be a good idea to revise the behaviour of the parser, trying to treat |
Hi, @diego-plan9, and welcome back! I agree with your analysis here 100%. You can get the comma back by escaping it, but it's likely enough to be used "incorrectly" that I think we can do better. And yes, I think the right solution is pretty much exactly that: the , character shouldn't be "special" when it appears outside of a function's argument (i.e., |
Thanks, sampsyo! I'll start working with that solution in mind and move the discussion to a pull request whenever a first draft is ready. |
Oh wow, yes, this does solve my problem! Thank you, @diego-plan9. Should we close this issue, then, since my problem is essentially fixed (user error!), or leave it open to keep track of the parser development? |
Let's leave it open. Thanks for checking back in! |
Closed after being fixed at #2213 |
Problem
Including a comma in a path yields incorrect path.
Running this command in verbose (
-vv
) mode:$ beet -vv ls -f 'Music/Pajo, David/%the{$albumartist_sort}/$releasedate. $album%aunique{}/$disc_and_track. $title' Pajo
Led to this problem:
Simply removing the comma in
Pajo, David
yields the expected result.Setup
My configuration (output of
beet config
) is:The text was updated successfully, but these errors were encountered: