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

A new commit has been pushed.

Repo   : rpms/amarok
Branch : epel10
Commit : b3bc784ee39e92024292faedda1ce17b5a71c72a
Author : Rex Dieter <rdieter@fedoraproject.org>
Date   : 2009-10-08T12:40:34+00:00
Stats  : +41/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/amarok/c/b3bc784ee39e92024292faedda1ce17b5a71c72a?branch=epel10

Log:
- upstream lyric.patch

---
diff --git a/amarok.spec b/amarok.spec
index fa170fc..5e33696 100644
--- a/amarok.spec
+++ b/amarok.spec
@@ -2,7 +2,7 @@
 Name:    amarok
 Summary: Media player
 Version: 2.2.0
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 Group: 	 Applications/Multimedia
 License: GPLv2+
@@ -12,6 +12,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Patch50: amarok-2.0.90-qtscript_not_required.patch
 
+## upstream patches
+# sigh, ride the lyric roller-coaster
+Patch100: lyric.patch
+
 BuildRequires: curl-devel
 BuildRequires: desktop-file-utils
 BuildRequires: gettext
@@ -79,6 +83,7 @@ Obsoletes: amarok-utilities < 2.0.96
 %setup -q 
 
 %patch50 -p1 -b .qtscript_not_required
+%patch100 -p1 -b .lyric
 
 
 %build
@@ -170,6 +175,9 @@ fi
 
 
 %changelog
+* Thu Oct 08 2009 Rex Dieter <rdieter@fedoraproject.org> 2.2.0-3
+- upstream lyric.patch
+
 * Fri Oct 02 2009 Rex Dieter <rdieter@fedoraproject.org> 2.2.0-2
 - Requires: kdebase-runtime (need kio_trash, kcm_phonon, etc)
 

diff --git a/lyric.patch b/lyric.patch
new file mode 100644
index 0000000..2c129b2
--- /dev/null
+++ b/lyric.patch
@@ -0,0 +1,32 @@
+diff --git a/src/scripts/lyrics_lyricwiki/main.js b/src/scripts/lyrics_lyricwiki/main.js
+index 60150f9..5c75473 100644
+--- a/src/scripts/lyrics_lyricwiki/main.js
++++ b/src/scripts/lyrics_lyricwiki/main.js
+@@ -97,10 +97,26 @@ function onFinished( response )
+                 return;
+             }
+             // parse the relevant part of the html source of the returned page
+-            relevant = /<div[^<>]*['"]lyricbox['"][^<>]*>(.*)<\/div>/.exec(response)[1];
++            var pos = response.indexOf( "lyricbox" );
++            var startPos = response.indexOf( ">", pos ) + 1;
++            var endPos = response.indexOf( "</div>", startPos );
++            var otherDivPos = response.indexOf( "<div", startPos );
++            while ( otherDivPos != -1 && otherDivPos < endPos ) {
++                endPos = response.indexOf( "</div>", endPos + 1 );
++                otherDivPos = response.indexOf( "<div", otherDivPos + 1 );
++            }
++            var relevant = response.substring( startPos, endPos );
+             // take care of a few special cases
+             relevant = relevant.replace(/<br\s*\/?>/g, "\n") + "\n\n"; // convert <br> to \n
+             relevant = relevant.replace( /&mdash;/g, "—" ); // not supported by QDomDocument
++            // strip adverts
++            pos = relevant.indexOf( "rtMatcher" );
++            while( pos != -1 ) {
++                startPos = relevant.lastIndexOf( "<div", pos );
++                endPos = relevant.indexOf( "</div>", pos );
++                relevant = relevant.substring( 0, startPos ) + relevant.substring( endPos + 6 );
++                pos = relevant.indexOf( "rtMatcher" );
++            }
+             // construct a QDomDocument to convert special characters in the lyrics text. 
+             doc2 = new QDomDocument();
+             doc2.setContent( "<?xml version=\"1.0\" encoding=\"UTF-8\"?><lyrics>" + relevant + "</lyrics>" );

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

only message in thread, other threads:[~2026-07-06 18:04 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:04 [rpms/amarok] epel10: - upstream lyric.patch Rex Dieter

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