i don't need a conditional in front of that like $if($gt(%totaltracks,0)) or $if(%totaltracks%)
2023-03-27 08623, 2023
yvanzo
If it is just for use in some bash script, then numbers can be padded with zeros using printf command, for example: printf "%02d" 9; echo
2023-03-27 08623, 2023
iconoclasthero
ultimately, i want the files named and displayed (i.e., from tags) that way if whatever is playing them will display them that way,
2023-03-27 08628, 2023
iconoclasthero
it seems vlc doesn't pad them
2023-03-27 08633, 2023
iconoclasthero
i haven't checked mpd yet
2023-03-27 08642, 2023
iconoclasthero
or mpc/gmpc i suppose
2023-03-27 08601, 2023
iconoclasthero
and they don't.
2023-03-27 08645, 2023
iconoclasthero
well, that makes me question the utility of going back and using e.g., mid3v2 to go back and change the tags instead of just having bash rename the files.
2023-03-27 08605, 2023
outsidecontext
iconoclasthero: it'll still depend on the players. those track and disc numbers are usually defined as integers. If the player interprets them this way and does its own formatting it doesn't matter if you add leading zeros. E.g. if the player maintains an internal database were it stores the track numbers as actual numbers. If the player just takes them as is and uses the strings it will work.
2023-03-27 08620, 2023
iconoclasthero
yep
2023-03-27 08638, 2023
iconoclasthero
you have any insights into mid3v2?
2023-03-27 08652, 2023
iconoclasthero
it isn't working with non-mp3 files.
2023-03-27 08615, 2023
outsidecontext
Also e.g. MP4 strictly stores track numbers as integers and not as strings, so it doesn't matter what you do
2023-03-27 08634, 2023
iconoclasthero
mp4, .opus, .ogg/vorbis, flac(?)
2023-03-27 08604, 2023
outsidecontext
well, it isn't supposed to. it's basically a replacement for the id3v2 command implemented in mutagen. it's handling id3 tags only
2023-03-27 08627, 2023
iconoclasthero
someone else said it was supposed to, lol.
2023-03-27 08640, 2023
iconoclasthero
not only that, the git page says it does.
2023-03-27 08651, 2023
iconoclasthero
what is picard using to modify those non-mp3 files?
2023-03-27 08618, 2023
iconoclasthero
<kepstin> if that's actually an opus file (ogg opus), mutagen works great
2023-03-27 08618, 2023
iconoclasthero
<kepstin> that error sounds like it's a different format with a filename ending in .opus
2023-03-27 08620, 2023
outsidecontext
picard uses mutagen
2023-03-27 08647, 2023
kepstin
picard uses the mutagen library directly as a library
2023-03-27 08600, 2023
iconoclasthero
yes.
2023-03-27 08602, 2023
outsidecontext
but mutagen at its core is a library. it just happens to also provide a handful of command line tools
2023-03-27 08612, 2023
iconoclasthero
yeah...
2023-03-27 08623, 2023
iconoclasthero
$ mutagen Yola\ Carter\ --\ 01\ -\ Home.opus
2023-03-27 08623, 2023
iconoclasthero
-- Yola Carter -- 01 - Home.opus
2023-03-27 08623, 2023
iconoclasthero
can't sync to MPEG frame
2023-03-27 08636, 2023
iconoclasthero
mutagen is aliased to mutagen-inspect
2023-03-27 08639, 2023
kepstin
note that picard actually has a fair amount of code to handle different file formats, they work so differently that mutagen doesn't provide a sufficiently powerful "generic" interface
2023-03-27 08647, 2023
iconoclasthero
ah
2023-03-27 08659, 2023
outsidecontext
yes, I answered you on the mutagen issue you opened
2023-03-27 08609, 2023
iconoclasthero
same answer?
2023-03-27 08617, 2023
iconoclasthero
haven't looked today
2023-03-27 08634, 2023
outsidecontext
that .opus file most likely is not a Ogg Opus file, as kepstin said. My guess is that it is most likely a Matroska file
2023-03-27 08649, 2023
outsidecontext
and mutagen does not support Matroska yet, unfortunately
2023-03-27 08652, 2023
kepstin
either that, or it got an id3 tag added to it
2023-03-27 08606, 2023
outsidecontext
or that
2023-03-27 08618, 2023
iconoclasthero
read it
2023-03-27 08622, 2023
kepstin
mid3v2 is a pretty simple tool, if used incorrectly it can mangle files by adding id3 tags when they're not supported by the format
2023-03-27 08633, 2023
iconoclasthero
let me look
2023-03-27 08613, 2023
iconoclasthero
mediainfo reports the container to be ogg and all of the files I put in opus came from ffmpeg -acodec libopus
iconoclasthero: yes, now I see it in the issue you reported. I missed that you used the mid3v2 command on that file first. that breaks the file by adding ID3 tags where there shouldn't be any
mutagen does not really care about the codec as it does not deal with the audio itself. it only cares about the container. that is ogg in this case, so that's fine.
2023-03-27 08608, 2023
outsidecontext
but you can't use mid3v2 with it, that's just not what that command is supposed to do
2023-03-27 08652, 2023
outsidecontext
in the end mutagen is probably not the right tool for you if you look for a command line tool to manipulate tags.
ffmpeg can fix the container to make it work with mutagen-inspect but if I shouldn't be using mid3v2 with those files than I suppose I need to find something else.
2023-03-27 08645, 2023
iconoclasthero
which I failed to do over the weekend.
2023-03-27 08654, 2023
iconoclasthero
does any of that help with the ticket or should i just close it?