rpms/amarok/F-11 amarok-parse-lyricwiki-website.patch, NONE, 1.1 amarok.spec, 1.149, 1.150

Rex Dieter rdieter at fedoraproject.org
Sun Aug 9 00:16:03 UTC 2009


Author: rdieter

Update of /cvs/pkgs/rpms/amarok/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21617

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/F-11/amarok.spec,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -p -r1.149 -r1.150
--- amarok.spec	13 Jun 2009 23:25:03 -0000	1.149
+++ amarok.spec	9 Aug 2009 00:16:03 -0000	1.150
@@ -2,7 +2,7 @@
 Name:    amarok
 Summary: Media player
 Version: 2.1.1
-Release: 1%{?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
@@ -41,7 +39,7 @@ BuildRequires: taglib-extras-devel
 %{?_qt4_version:Requires: qt4 >= %{_qt4_version}}
 %{?kdelibs4_version:Requires: kdelibs4 >= %{kdelibs4_version}}
 BuildRequires: qtscriptbindings
-Requires: qtscriptbindings
+Requires: qtscriptbindings%{?_isa}
 Requires: %{name}-utils = %{version}-%{release}
 
 Obsoletes: amarok-devel < 1.4.9 
@@ -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,15 @@ 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
+
+* Tue Jul 07 2009 Rex Dieter <rdieter at fedoraproject.org> 2.1.1-2
+- Requires: qtscriptbindings%%{?_isa}  (#510133)
+
 * Fri Jun 12 2009 Rex Dieter <rdieter at fedoraproject.org> 2.1.1-1
 - amarok-2.1.1
 




More information about the fedora-extras-commits mailing list