Duplicate Last Track


#1

Hi. I'm working on my first source script with Puddletag 1.0.0 beta 4 (Linux) which supports MP3Tag source scripts. I'm just about finished and my problm shouldn't really affect the result but it's just a bug I'd like to fix.

I can pull all artist information adn track information but the final track of each album is shown twice! I was hoping maybe someone could spot if there's a problem with my loop or (avoiding the issue) if there's a way to drop the last entry from the track array. :stuck_out_tongue: Here's the relevant code:

findline "<tracklist>"
joinuntil "</tracklist>"
do
        outputto "TRACKS"
        findinline "<track>"

        outputto "TRACK"
        findinline "<number>"
        sayuntil "</number>"

        outputto "TITLE"
        findinline "<title>"
        sayuntil "</title>"

        outputto "LENGTH"
        findinline "<length>"
        sayuntil "</length>"

        #outputto "UNSYNCEDLYRICS"
        #findline "<lyrics>"
        #sayuntil "</lyrics>"

        say "|"
        findinline "</track>"
while "<track>"

This gives me two "9 - Void" tracks. My XML source can be viewed here. Thanks in advance! :w00t:


#2

PT has its own support forum. You should ask there.


#3

Are you sure your code is correct? It is missing several
say "|" commands.

So at the moment it does not work with Mp3tag.

And please provide a raw xml sample without linebreaks and indent spaces.


#4

Thanks for getting back to me. From the Puddletag website, they're focussed on PyParser: :stuck_out_tongue:

It does work as you can see in the screenshot just it adds the last track twice. It shan't cause an issue during tagging as you can't tag track 10 as a duplicate of track 9 if there are only 9 tracks. Just aesthetic, as far as I can tell.

Raw XML: http://paste2.org/p/1946696
Screenshot: http://imgur.com/TdFC1
Source: http://minus.com/mbaVU0Dkgb/


#5

Well it looks like a puddletag specific issue so I can't really help you.

But I can post the modified code that works in Mp3tag:

findline "<tracklist>"
joinuntil "</tracklist>"
do

outputto "TRACKS"
findinline "<track>"

#outputto "TRACK"
#findinline "<number>"
#sayuntil "</number>"

#outputto "TITLE"
findinline "<title>"
sayuntil "</title>"
say "|"

outputto "_LENGTH"
findinline "<length>"
sayuntil "</length>"

#outputto "UNSYNCEDLYRICS"
#findline "<lyrics>"
#sayuntil "</lyrics>"

say "|"
findinline "</track>"
while "<track>"

#6

Thanks a lot for that. It hasn't fixed anything in Puddletag and now it doesn't get the track numbers but I'll get a Windows VM going and test it in MP3Tag.

This is for Metal-Archives (as you might have guessed) but I'd like to do this for other tag sources that similarly don't provide APIs and parse them on my server to coax XML out of them as you can see here because I think there's a lot of user frustration and probably a lack of adoption due to broken tag source scripts that require users to edit the script or replace it with a fixed one (if they find their way onto this forum) where as an external server is a controlled resource that can be updated in the event of site changes (like MAv2). Such a server could have multiple tag source administrators if it was believed that even one person couldn't handle the number of site changes that would break parsing. Has this been considered or are there legal implications?