public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/amarok] epel10.2: - lyricwiki patch (kdebug#202366)
@ 2026-07-06 18:30 Rex Dieter
  0 siblings, 0 replies; only message in thread
From: Rex Dieter @ 2026-07-06 18:30 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/amarok
Branch : epel10.2
Commit : 1b2a59e5ebe7efddd61fc067ed621d4c8728e441
Author : Rex Dieter <rdieter@fedoraproject.org>
Date   : 2009-08-09T00:11:46+00:00
Stats  : +64/-6 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/amarok/c/1b2a59e5ebe7efddd61fc067ed621d4c8728e441?branch=epel10.2

Log:
- lyricwiki patch (kdebug#202366)

---
diff --git a/amarok-parse-lyricwiki-website.patch b/amarok-parse-lyricwiki-website.patch
new file mode 100644
index 0000000..b3e8cac
--- /dev/null
+++ b/amarok-parse-lyricwiki-website.patch
@@ -0,0 +1,56 @@
+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 )

diff --git a/amarok.spec b/amarok.spec
index b29cc35..ee88664 100644
--- a/amarok.spec
+++ b/amarok.spec
@@ -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}-%{release}-root-%(%{__id_u} -n)
 
 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@fedoraproject.org> 2.1.1-4
+- lyricwiki patch (kdebug#202366)
+
 * Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-06 18:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-06 18:30 [rpms/amarok] epel10.2: - lyricwiki patch (kdebug#202366) Rex Dieter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox