Summary: | [PATCH] support for meta lyrics scripts | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Sergio Pistone <sergio_pistone> |
Component: | Context View | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | 1.4.5 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
mentioned patch
patch against amarok-1.4.5; fixes bug in the previous one |
Description
Sergio Pistone
2007-02-18 20:33:54 UTC
Created attachment 19732 [details]
mentioned patch
Created attachment 19738 [details]
patch against amarok-1.4.5; fixes bug in the previous one
SVN commit 639672 by dmeltzer: Allow for lyrics scripts to work as meta_lyrics scripts, with the ability to specify site, site_url, and add_url as returned paramaters in the fetched lyrics. Still falls back to parameters set in the .spec file. Patch by Sergio pistone. <sergio_pistone@yahoo.co.ar> BUG: 141885 M +3 -0 ChangeLog M +14 -10 src/contextbrowser.cpp --- branches/stable/extragear/multimedia/amarok/ChangeLog #639671:639672 @@ -7,6 +7,9 @@ CHANGES: * First rating star now lets you toggle between no rating, half a star, and one full star. + * Allow for lyrics scripts to specifiy site, site_url, and add_url from + within the script. This will allow for "meta lyrics" scripts. .Patch by + Sergio Pistone <sergio_pistone@yahoo.com.ar> (BR 141885) BUGFIXES: * Fix detection of vfat devices on FreeBSD. (BR 141614) --- branches/stable/extragear/multimedia/amarok/src/contextbrowser.cpp #639671:639672 @@ -3372,13 +3372,17 @@ KConfig spec( sm->specForScript( sm->lyricsScriptRunning() ), true, false ); spec.setGroup( "Lyrics" ); - m_lyricAddUrl = spec.readPathEntry( "add_url" ); - m_lyricAddUrl.replace( "MAGIC_ARTIST", KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ) ); - m_lyricAddUrl.replace( "MAGIC_TITLE", KURL::encode_string_no_slash( EngineController::instance()->bundle().title() ) ); - m_lyricAddUrl.replace( "MAGIC_ALBUM", KURL::encode_string_no_slash( EngineController::instance()->bundle().album() ) ); - m_lyricAddUrl.replace( "MAGIC_YEAR", KURL::encode_string_no_slash( QString::number( EngineController::instance()->bundle().year() ) ) ); + if ( el.attribute( "add_url" ).isEmpty() ) + { + m_lyricAddUrl = spec.readPathEntry( "add_url" ); + m_lyricAddUrl.replace( "MAGIC_ARTIST", KURL::encode_string_no_slash( EngineController::instance()->bundle().artist() ) ); + m_lyricAddUrl.replace( "MAGIC_TITLE", KURL::encode_string_no_slash( EngineController::instance()->bundle().title() ) ); + m_lyricAddUrl.replace( "MAGIC_ALBUM", KURL::encode_string_no_slash( EngineController::instance()->bundle().album() ) ); + m_lyricAddUrl.replace( "MAGIC_YEAR", KURL::encode_string_no_slash( QString::number( EngineController::instance()->bundle().year() ) ) ); + } + else + m_lyricAddUrl = el.attribute( "add_url" ); - if ( el.tagName() == "suggestions" ) { @@ -3408,10 +3412,10 @@ lyrics = el.text(); lyrics.replace( "\n", "<br/>\n" ); // Plaintext -> HTML - const QString title = el.attribute( "title" ); - const QString artist = el.attribute( "artist" ); - const QString site = spec.readEntry( "site" ); - const QString site_url = spec.readEntry( "site_url" ); + const QString title = el.attribute( "title" ); + const QString artist = el.attribute( "artist" ); + const QString site = el.attribute( "site" ).isEmpty() ? spec.readEntry( "site" ) : el.attribute( "site" ); + const QString site_url = el.attribute( "site_url" ).isEmpty() ? spec.readEntry( "site_url" ) : el.attribute( "site_url" ); lyrics.prepend( "<font size='2'><b>\n" + title + "</b><br/><u>\n" + artist+ "</font></u></font><br/>\n" ); |