Track 'version' between parenthesis, instead of XML tag

9 views
Skip to first unread message

Helder Martins

unread,
Jan 6, 2012, 12:12:48 PM1/6/12
to 7digital API Developers
Something that bugged me for a while, but not so critical. I noticed
that even having the attribute 'version' in the 'track/details'
method, most of the time (in my case) the version is being returned in
the title of the song between parenthesis (sometimes with brackets
too). For example, Pink Floyd's top song is 'Another Brick In The
Wall, Pt. 1 (2011 - Remaster)'. I'd expect that '2011 - Remaster'
would be returned in the 'version' attribute, and not in the title. It
is important to my app showing this info, but I also think that it
leaves the interface not so elegant with long song titles. Is that
correct and expected? If it is, what is the difference that we should
expect between this data and the one provided by the 'version'
attribute?

Since I already print the 'version' attribute with a different and
smaller style, I was thinking of some method of fixing that, like
parsing that data between parenthesis and printing with the 'version'
style in a different position. But I also fear of parsing wrong data,
like songs that do have parenthesis in the title. Any idea how that
parsing could be done?

Regards,

Helder M

filip

unread,
Jan 10, 2012, 9:32:43 AM1/10/12
to 7digital API Developers
Hi Helder,

unfortunately this is how some content providers deliver us the
metadata.

You can try to work around it in a crude way using a reg ex like this
-
/\s+\(.*(version|mix|remix|edit|edition|live|feat|clean|video|delux|
exclusive|original|remaster).*\)/i

You'll probably miss-match some data but for your display purposes it
might be good enough.

Cheers
Filip
7digital
Reply all
Reply to author
Forward
0 new messages