rpms/amarok/devel amarok-parse-lyricwiki-website.patch, NONE, 1.1 amarok.spec, 1.158, 1.159
Rex Dieter
rdieter at fedoraproject.org
Sun Aug 9 00:11:46 UTC 2009
Author: rdieter
Update of /cvs/pkgs/rpms/amarok/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv20078
Modified Files:
amarok.spec
Added Files:
amarok-parse-lyricwiki-website.patch
Log Message:
* Sat Aug 08 2009 Rex Dieter <rdieter at fedoraproject.org> 2.1.1-4
- lyricwiki patch (kdebug#202366)
amarok-parse-lyricwiki-website.patch:
main.js | 36 +++++++++++++++++++++++++++++++-----
1 file changed, 31 insertions(+), 5 deletions(-)
--- NEW FILE amarok-parse-lyricwiki-website.patch ---
diff --git a/src/scripts/lyrics_lyricwiki/main.js b/src/scripts/lyrics_lyricwiki/main.js
index bce329c..d2b9902 100644
--- a/src/scripts/lyrics_lyricwiki/main.js
+++ b/src/scripts/lyrics_lyricwiki/main.js
@@ -27,6 +27,31 @@ Importer.loadQtBinding( "qt.core" );
Importer.loadQtBinding( "qt.xml" );
xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><lyric artist=\"{artist}\" title=\"{title}\">{lyrics}</lyric>";
+newxml = "";
+
+function onFinished2( response )
+{
+ try
+ {
+ if( response.length == 0 )
+ Amarok.Lyrics.showLyricsError( "Unable to contact server - no website returned" ); // TODO: this should be i18n able
+ else
+ {
+ doc2 = new QDomDocument();
+ doc2.setContent( response );
+ textboxtext = doc2.elementsByTagName( "textarea" ).at( 0 ).toElement().text();
+ lyr = /<lyrics>(.*)<\/lyrics>/.exec(textboxtext)[1];
+ //Amarok.debug( "matched: " + lyr );
+ newxml = newxml.replace( "{lyrics}", Amarok.Lyrics.escape( lyr ) );
+ Amarok.Lyrics.showLyrics( newxml );
+ }
+ }
+ catch( err )
+ {
+ Amarok.Lyrics.showLyricsError( "Could not retrieve lyrics: " + err );
+ Amarok.debug( "error: " + err );
+ }
+}
function onFinished( dat )
{
@@ -38,13 +63,14 @@ function onFinished( dat )
{
doc = new QDomDocument();
doc.setContent( dat );
- parsedContent = doc.elementsByTagName( "lyrics" ).at( 0 ).toElement().text();
- parsedContent = parsedContent.replace( "<lyrics>", "" ).replace( "</lyrics>", "" ); // some lyrics have 2 lyrics in them...wtf?
newxml = xml.replace( "{artist}", Amarok.Lyrics.escape( doc.elementsByTagName( "artist" ).at( 0 ).toElement().text() ) );
newxml = newxml.replace( "{title}", Amarok.Lyrics.escape( doc.elementsByTagName( "song" ).at( 0 ).toElement().text() ) );
- newxml = newxml.replace( "{lyrics}", Amarok.Lyrics.escape( parsedContent ) );
- //Amarok.debug( "showing lyrics:" + newxml );
- Amarok.Lyrics.showLyrics( newxml );
+ Amarok.debug( "returned URL: " + doc.elementsByTagName( "url" ).at( 0 ).toElement().text());
+ var url = decodeURI(doc.elementsByTagName( "url" ).at( 0 ).toElement().text());
+ url = url.replace( /lyricwiki\.org\//, "lyricwiki.org/index.php?action=edit&title=" );
+ var url2 = new QUrl(url);
+ Amarok.debug( "request-2 URL: " + url2.toString() );
+ new Downloader( url2, onFinished2 );
}
}
catch( err )
Index: amarok.spec
===================================================================
RCS file: /cvs/pkgs/rpms/amarok/devel/amarok.spec,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -p -r1.158 -r1.159
--- amarok.spec 24 Jul 2009 16:49:52 -0000 1.158
+++ amarok.spec 9 Aug 2009 00:11:46 -0000 1.159
@@ -2,7 +2,7 @@
Name: amarok
Summary: Media player
Version: 2.1.1
-Release: 3%{?dist}
+Release: 4%{?dist}
Group: Applications/Multimedia
License: GPLv2+
@@ -12,11 +12,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version
Patch50: amarok-2.0.90-qtscript_not_required.patch
-# svn diff \
-# svn://anonsvn.kde.org/home/kde/tags/amarok/2.0.96/amarok/ \
-# svn://anonsvn.kde.org/home/kde/trunk/extragear/multimedia/amarok/
-# and manually tweaked a bit to apply
-#Patch100: amarok-%{snap}svn.patch.gz
+## upstream patches
+# https://bugs.kde.org/show_bug.cgi?id=202366
+Patch100: amarok-parse-lyricwiki-website.patch
BuildRequires: curl-devel
BuildRequires: desktop-file-utils
@@ -69,6 +67,7 @@ Obsoletes: amarok-utilities < 2.0.96
%setup -q
%patch50 -p1 -b .qtscript_not_required
+%patch100 -p1 -b .lyricwiki
%build
@@ -150,6 +149,9 @@ fi
%changelog
+* Sat Aug 08 2009 Rex Dieter <rdieter at fedoraproject.org> 2.1.1-4
+- lyricwiki patch (kdebug#202366)
+
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
More information about the fedora-extras-commits
mailing list