Add config option to disable padding for track, tracktotal, disc and disctotal + add path format functions for padding

62 views
Skip to first unread message

Peter Schnebel

unread,
Feb 28, 2013, 6:08:00 AM2/28/13
to beets...@googlegroups.com
Hi.

ATM track, tracktotal, disc and disctotal are padded with zeros to a length of 2.  While this is usually a good idea for track, it is IMO unnecessary for disc and disctotal.  Also for releases with more than 100 tracks (and per_disc_numbering: no) it does not make a lot of sense (or should be padded to a length of 3).

My suggestion would be:  Add a new config option to configure the padding of indices.  e.g.:

pad_indices: $target_length

with the default being 2, so that nothing changes for people not wanting anything different.  Alternatively add 2 config options pad_track_indices and pad_disc_indices.

To get the behavior I desire, I would add 2 new path format functions:

  %pad{$value, $length, $pad_char='0'}:  pad $value to a target length of $length with character $pad_char. e.g. %pad{2, 3, 0} yields 003
  %len{$value}: get the length of $value. e.g. %len{2} yields 1

So I could add:

  %pad{$disc, %len{$disctotal}, 0}

to appropriately pad the disc number.

Any thoughts?

Peter

Peter Schnebel

unread,
Feb 28, 2013, 10:31:24 AM2/28/13
to beets...@googlegroups.com
This is also solved with the inline plugin.

Sorry for the fuzz :)



Peter

--
You received this message because you are subscribed to the Google Groups "beets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beets-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages