Bug 222930 - Custom stations for last.fm shown as url encoded in playlist
Summary: Custom stations for last.fm shown as url encoded in playlist
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlist (show other bugs)
Version: 2.3.0
Platform: unspecified Linux
: NOR normal
Target Milestone: 2.3.0
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-16 06:40 UTC by Vovochka
Modified: 2010-05-10 09:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.1


Attachments
screenshot (70.83 KB, image/png)
2010-01-16 06:41 UTC, Vovochka
Details
new screenshot :) (154.93 KB, image/png)
2010-03-17 09:08 UTC, Vovochka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vovochka 2010-01-16 06:40:53 UTC
Version:           2.2.2 (using 4.3.90 (KDE 4.3.90 (KDE 4.4 RC1)) "release 209", KDE:KDE4:Factory:Desktop / openSUSE_11.2)
Compiler:          gcc
OS:                Linux (x86_64) release 2.6.31.8-0.1-desktop

When adding a custom last.fm station with not latin label, it's shown url encoded in playlist.
Comment 1 Vovochka 2010-01-16 06:41:54 UTC
Created attachment 39935 [details]
screenshot
Comment 2 Vovochka 2010-03-17 01:28:38 UTC
2.3

Bug still exists.
Comment 3 Myriam Schweingruber 2010-03-17 08:58:12 UTC
Changed version. Can somebody please confirm this?
Comment 4 Vovochka 2010-03-17 09:08:21 UTC
Created attachment 41708 [details]
new screenshot :)
Comment 5 Soren Harward 2010-05-10 03:41:08 UTC
commit 7fc8c8b37d321dce4a8ab506318bb175d77f2c54
Author: Soren Harward <stharward@gmail.com>
Date:   Sun May 9 21:08:23 2010 -0400

    Display extended characters in Last.fm stream names properly
    
    Instead of displaying names with HTML-entities for extended characters,
    display the characters themselves.
    
    Examples:
    
    "Hüsker Dü" instead of "H%252sker%20D%252"
    "Mötorhead" instead of "M%246torhead"
    
    BUG: 222930

diff --git a/ChangeLog b/ChangeLog
index 2be1769..1ca2a1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@ VERSION 2.3.1
   CHANGES:
 
   BUGFIXES:
+    * Display extended characters properly in names of Last.fm streams.
+      (BR 222930)
     * Cover fetcher: prevent automatic fetcher from setting album's cover if
       it is done manually during the download. (BR 236839)
     * File browser: show folders first, files afterwards. Patch by
diff --git a/src/services/lastfm/meta/LastFmMeta.cpp b/src/services/lastfm/meta/LastFmMeta.cpp
index dba4d20..3183521 100644
--- a/src/services/lastfm/meta/LastFmMeta.cpp
+++ b/src/services/lastfm/meta/LastFmMeta.cpp
@@ -34,6 +34,7 @@
 #include "core/support/Debug.h"
 
 #include <QPointer>
+#include <QUrl>
 
 #include <KSharedPtr>
 #include <KStandardDirs>
@@ -382,9 +383,7 @@ Track::streamName() const
     QStringList elements = d->lastFmUri.toString().split( '/', QString::SkipEmptyParts );
     if( elements.size() >= 2 && elements[0] == "lastfm:" )
     {
-        QString customPart = elements[2];
-        customPart = customPart.replace( "%20", " " );
-
+        QString customPart = QUrl::fromPercentEncoding( elements[2].toUtf8() );
 
         if( elements[1] == "globaltags" )
         {