Hey,

The lyricswiki script is broken on some newer entries.
http://lyrics.wikia.com/api.php?action=query&prop=revisions&rvprop=content&format=xml&titles=Third_Eye_Blind:Dopamine

The lyrics are contained within the "rev" tag on this song.

The following patch will fix that and lyrics will work on these songs.
Otherwise, you only get an error message.

I can't find a better place to submit patches, so if there is please
redirect me to it...
--- src/scripts/lyrics_lyricwiki/main.js.orig	2016-11-12 16:56:48.000000000 -0500
+++ src/scripts/lyrics_lyricwiki/main.js	2016-11-12 16:57:21.000000000 -0500
@@ -8,6 +8,7 @@
 *   (C) 2008 Mark Kretschmann <kretschm...@kde.org>                       *
 *   (C) 2008 Peter ZHOU <peterzhou...@gmail.org>                          *
 *   (C) 2009 Jakob Kummerow <jakob.kumme...@gmail.com>                    *
+*   (C) 2016 Tim Savannah <kata...@gmail.com>                             *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
@@ -115,6 +116,16 @@
                 NEWXML = NEWXML.replace( "{lyrics}", Amarok.Lyrics.escape( response.substring(lindex, rindex) ) );
                 Amarok.Lyrics.showLyrics( NEWXML );
             }
+			else if(capture = /<(rev[\s\S]*>)/i.exec(response))
+			{
+				// Sometimes lyrics can be between <rev> tag.
+				// Example: http://lyrics.wikia.com/api.php?action=query&prop=revisions&rvprop=content&format=xml&titles=Third_Eye_Blind:Dopamine
+				var lindex = response.indexOf("<" + capture[1] + capture[1].length + 1;
+				var rindex = response.indexOf('</' + capture[1]);
+
+                NEWXML = NEWXML.replace( "{lyrics}", Amarok.Lyrics.escape( response.substring(lindex, rindex) ) );
+                Amarok.Lyrics.showLyrics( NEWXML );
+			}
             else if(capture = /#redirect\s+\[\[(.+)\]\]/i.exec(response))
             { // redirect pragma found: #REDIRECT [[Band:Song]]
                 redirects++;

Reply via email to