mirror of
https://gitlab.com/RemixDev/deemix-js.git
synced 2024-12-28 02:16:08 +00:00
Added padSingleDigit option
This commit is contained in:
parent
2d426d850d
commit
7aebaf0ade
|
@ -35,6 +35,7 @@ const DEFAULTS = {
|
||||||
createStructurePlaylist: false,
|
createStructurePlaylist: false,
|
||||||
createSingleFolder: false,
|
createSingleFolder: false,
|
||||||
padTracks: true,
|
padTracks: true,
|
||||||
|
padSingleDigit: true,
|
||||||
paddingSize: "0",
|
paddingSize: "0",
|
||||||
illegalCharacterReplacer: "_",
|
illegalCharacterReplacer: "_",
|
||||||
queueConcurrency: 3,
|
queueConcurrency: 3,
|
||||||
|
|
|
@ -50,7 +50,7 @@ function pad(num, max_val, settings) {
|
||||||
} else{
|
} else{
|
||||||
paddingSize = ((10 ** (parseInt(settings.paddingSize) - 1))+"").length
|
paddingSize = ((10 ** (parseInt(settings.paddingSize) - 1))+"").length
|
||||||
}
|
}
|
||||||
if (paddingSize == 1) paddingSize = 2
|
if (settings.padSingleDigit && paddingSize == 1) paddingSize = 2
|
||||||
|
|
||||||
if (settings.padTracks) return (num+"").padStart(paddingSize, "0")
|
if (settings.padTracks) return (num+"").padStart(paddingSize, "0")
|
||||||
return (num+"")
|
return (num+"")
|
||||||
|
|
Loading…
Reference in a new issue