Bug 142764 - amarok keeps getting wikipedia information in endless loop if info in wikipedia doesn't exist
Summary: amarok keeps getting wikipedia information in endless loop if info in wikiped...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Context View (show other bugs)
Version: 1.4.6
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 142177 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-03-09 21:20 UTC by Lasse Liehu
Modified: 2007-08-03 10:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lasse Liehu 2007-03-09 21:20:21 UTC
Version:           1.4.5 (using KDE KDE 3.5.6)
Installed from:    Ubuntu Packages
Compiler:          gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
 
OS:                Linux

Looks like Amarok doesn't understand to stop trying to get Wikipedia information if it doesn't exist, but tries and tries, and fetches the page again and again from Wikipedia, resulting in constant job messages about fetching and that one can't switch to any other tabs in context view or it'll switch back to Wikipedia info one after about a few seconds.

If you already have Wikipedia tab open in context view and then switch song, it won't try to do the same, though. Only after you change to some other tab in context view and then back to Wikipedia one.

Actually I'm not 100% sure that this happens because info isn't available, but at least it happens when it isn't available.
Comment 1 Alexandre Oliveira 2007-03-09 22:25:46 UTC
Without an example of an artist/album or whatever that causes this the report is useless.
Comment 2 Lasse Liehu 2007-03-10 11:08:32 UTC
OK. Steps to reproduce (and some info I found about after making the report):
1. Set Wikipedia's locale to fi (I don't know if this can be reproduced with other locales as well, but with "English" locale I was not able to reproduce).
2. Start playing a song that doesn't have any Wikipedia information about it's artist, album or the song itself like this one: http://www.shadowgroundsgame.com/media/music/ShadowgroundsOST-01-MainTheme.mp3
3. Change active context view to something other than Wikipedia and then switch to Wikipedia one again
4. Amarok starts fetching Wikipedia information and keeps trying to fetch it in endless loop until the played song changes (or playing is stopped).

I don't know if this matters but my KDE language locale is British English and LOCALE environment variable is: fi_FI:fi:en_GB:en
Comment 3 Kevin Funk 2007-03-10 12:56:18 UTC
Related or a dup to bug 142177.
Comment 4 Martin Aumueller 2007-03-10 14:56:53 UTC
*** Bug 142177 has been marked as a duplicate of this bug. ***
Comment 5 Martin Aumueller 2007-03-10 14:57:54 UTC
confirming, because its dupe was
Comment 6 Philipp W 2007-04-11 22:57:02 UTC
I can confirm this bug. My locale is "de"
Comment 7 Arseny Solokha 2007-06-20 09:52:48 UTC
I can confirm this bug. My locale is "ru"
Comment 8 rtfmspam 2007-06-22 13:26:13 UTC
I can confirm this bug. My locale is "de".
I am using amarok 1.4.6 with kde 3.5.7.
Comment 9 Mark Kretschmann 2007-08-03 10:45:37 UTC
SVN commit 695895 by markey:

Wikipedia artist lookup would freeze Amarok if the artist was not found and the locale was not English.

This was because of this nasty detail: QString.endsWidth( "" ) always returns true, not false.

BUG: 142764



 M  +2 -0      ChangeLog  
 M  +5 -3      src/contextbrowser.cpp  


--- branches/stable/extragear/multimedia/amarok/ChangeLog #695894:695895
@@ -12,6 +12,8 @@
       Gosta <gostaj@gmail.com>. (BR 142999)
 
   BUGFIXES:
+    * Wikipedia artist lookup would freeze Amarok if the artist was not found
+      and the locale was not English. (BR 142764)
     * Cannot limit smart playlists to more than 1000 tracks. (BR 148084)
     * Fixed the formatting in the "Extended Info" pane for podcasts.
     * Don't show "Not Rated" for items rated with half a star. Patch by Tuomas
--- branches/stable/extragear/multimedia/amarok/src/contextbrowser.cpp #695894:695895
@@ -4115,20 +4115,22 @@
 
     if( m_wiki.find( "var wgArticleId = 0" ) != -1 )
     {
+        debug() << "Article not found." << endl;
+        
         // article was not found
-        if( m_wikiCurrentEntry.endsWith( wikiArtistPostfix() ) )
+        if( !wikiArtistPostfix().isEmpty() && m_wikiCurrentEntry.endsWith( wikiArtistPostfix() ) )
         {
             m_wikiCurrentEntry = m_wikiCurrentEntry.left( m_wikiCurrentEntry.length() - wikiArtistPostfix().length() );
             reloadWikipedia();
             return;
         }
-        else if( m_wikiCurrentEntry.endsWith( wikiAlbumPostfix() ) )
+        else if( !wikiAlbumPostfix().isEmpty() && m_wikiCurrentEntry.endsWith( wikiAlbumPostfix() ) )
         {
             m_wikiCurrentEntry = m_wikiCurrentEntry.left( m_wikiCurrentEntry.length() - wikiAlbumPostfix().length() );
             reloadWikipedia();
             return;
         }
-        else if( m_wikiCurrentEntry.endsWith( wikiTrackPostfix() ) )
+        else if( !wikiTrackPostfix().isEmpty() && m_wikiCurrentEntry.endsWith( wikiTrackPostfix() ) )
         {
             m_wikiCurrentEntry = m_wikiCurrentEntry.left( m_wikiCurrentEntry.length() - wikiTrackPostfix().length() );
             reloadWikipedia();