MartO
September 21, 2014, 5:58pm
1
OK, I know I can write the mp3 track and total tracks info in a command like so:
SetAttr Meta "track:7/42"
And in a script, this is how to read the track number:
var track = item().metadata.audio.mp3track;
But how do I read the total tracks number?
(What I'm trying to achieve is to read 'total tracks' from the selected files and check if they all have the same value.)
Thanks,
MartO
tbone
September 21, 2014, 6:27pm
2
I think, if totaltrack number is set, it is in mp3track too, separated by "/". That's how it works for discnumber at least.
MartO
September 21, 2014, 6:36pm
3
Yes, thanks, I guess it should be, but reading mp3track returns only one value and no "/".
Leo
September 21, 2014, 6:56pm
4
Try metadata.audio_text instead of metadata.audio. (Also remember the string could be any old garbage put in by a tagging tool, so be prepared if it isn't a number or starts with a space, etc.)
1 Like
MartO
September 21, 2014, 7:02pm
5
That's it, thanks!
(Yes, I realize I might have to do some cleaning...)