public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Rex Dieter <rdieter@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/amarok] epel10.2: - upstream lyric.patch
Date: Mon, 06 Jul 2026 18:30:58 GMT	[thread overview]
Message-ID: <178336265816.1.1007186982632783745.rpms-amarok-b3bc784ee39e@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/amarok
Branch : epel10.2
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.2

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>" );

                 reply	other threads:[~2026-07-06 18:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178336265816.1.1007186982632783745.rpms-amarok-b3bc784ee39e@fedoraproject.org \
    --to=rdieter@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox