-
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
$track numbering loses it's zero padding if inside an if statement #3709
Comments
Hi! I think perhaps a simpler explanation here is that
Some ways to add padding might include the |
EDIT: Let me try replacing $track-alt with track to try and eliminate one option, will up-date this comment with the results EDIT 2: Ignore the above, items seems @sampsyo was on point that EDIT 3: Main difference between current config and past configs is the use of the album_fields as well as item_fields, in the past I have exclusively used item_fields, could this have any affect on my results/outcome? |
A good way to debug these things is to use
I don't see anything obviously wrong with that definition, but maybe checking that all the values hold what you think they hold would be useful. |
$ beet ls -f '$track_alt - $album'
1 - Celeste Original Soundtrack
2 - Celeste Original Soundtrack
3 - Celeste Original Soundtrack
4 - Celeste Original Soundtrack
5 - Celeste Original Soundtrack
6 - Celeste Original Soundtrack
7 - Celeste Original Soundtrack
8 - Celeste Original Soundtrack
9 - Celeste Original Soundtrack
10 - Celeste Original Soundtrack
11 - Celeste Original Soundtrack
12 - Celeste Original Soundtrack
13 - Celeste Original Soundtrack
14 - Celeste Original Soundtrack
15 - Celeste Original Soundtrack
16 - Celeste Original Soundtrack
17 - Celeste Original Soundtrack
18 - Celeste Original Soundtrack
19 - Celeste Original Soundtrack
20 - Celeste Original Soundtrack
21 - Celeste Original Soundtrack And if I was to run above with $track it shows padding as intended. $ beet ls -f '$media $alt_tracks - $album'
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack
Digital Media 0 - Celeste Original Soundtrack The media doesn't fit the true condition for |
You can keep debugging that too!! Try using the |
I was missing $ in front of the alt_tracks, so the if condition never had anything to check and automatically defaulted to the first value. Closing because of user error. |
Problem
$track
numbering loses it's zero padding if inside an if statementWith a default path set as following (Padding as expected):
default: Music/%upper{%left{$albumartist_sort,1}}/$albumartist/%if{$hasyear,($year)} $album%aunique{} $alb_type$alb_status$media_type/%if{$multidisc,Disc $disc/}$track. $title
My tack listings are zero padded and look like the following screenshot
When I have it inside an if statement (Padding fails):
default: Music/%upper{%left{$albumartist_sort,1}}/$albumartist/%if{$hasyear,($year)} $album%aunique{} $alb_type$alb_status$media_type/%if{$multidisc,Disc $disc/}%if{alt_tracks,$track_alt,$track}. $title
My track listings are not zero padded and look like the following screenshot
Switching from
%if{alt_tracks,$track_alt,$track}. $title
to$track. $title
:Switching from
$track. $title
back to%if{alt_tracks,$track_alt,$track}. $title
(Aka reverting my config change):Setup
Linux thonkpad 5.6.18-156.current #1 SMP PREEMPT Sun Jun 21 07:16:38 UTC 2020 x86_64 GNU/Linux
3.7.7
1.4.9
My configuration is:
Looking at a comment in issue 3352, it mentions that beets zero pads the track automatically (to 2 digits at least), which leads me to believe that this is missed if you go down a different code path then what is considered "default"
The text was updated successfully, but these errors were encountered: