Make it possible to set a length when padding trackno, discno, presently can just elect whether or not to pad and only works for releases upto 99 tracks

Issue #45 new
IJabz repo owner created an issue

From https://java.net/jira/browse/JAUDIOTAGGER-431

This is a continuation of JAUDIOTAGGER-379

Added padNumberTotalLength which specify how many zeroes to append, this only has any effect if padNumbers is set to true.

If set to PAD_ONE_ZERO, 9 -> 09 , 99 -> 99 , 999 ->999 If set to PAD_TWO_ZERO, 9 -> 009 , 99 -> 099 , 999 ->999 If set to PAD_THREE_ZERO, 9 -> 0009 , 99 -> 0099 , 999 ->0999

Note if enabled values read from existing files will also be shown as padded even if they are not padded in the underlying file, not sure if this is a good or bad idea but is how it currently works.

Also realised that the setRawText() field in the PartofSet.PartOFsetValue class is not easily accessible and not used by the generic interface therefore it is difficult to prepad because jaudiotagger will just convert the value to integer and you'll lose the padding, i.e the logic was assuming that if padNumbers was false you didnt want your numbers padded when in fact it just meant you didnt want jaudiotagger to do the padding. For example jaudiotagger working in the conext of one individual file at a time, if you want to set padding based on the largest track no in a particular group of files (i.e an album) you could implement this by modifying padNumberTotalLength as you start writing each album, or do the pading yourself in the calling application. So now changed the generic interface that it preserves whatever values are passed to it for count and total , and this is what is used if padNumbers is set to false.

Also padding is currently only implemented for ID3, but I dont see why it shouldn't be implemented for Flac and Ogg. We cannot write padded values to mp4, but we could return the value as padded if that is useful.

Comments (0)

  1. Log in to comment