Bug 188446 - [Patch] Fech cover locales and servers aren't assigned correctly
Summary: [Patch] Fech cover locales and servers aren't assigned correctly
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.0.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-30 05:02 UTC by Ignacio Serantes
Modified: 2009-08-01 15:04 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ignacio Serantes 2009-03-30 05:02:12 UTC
Version:           2.0.2 (using 4.2.1 (KDE 4.2.1) "release 106", KDE:KDE4:Factory:Desktop / openSUSE_11.1)
Compiler:          gcc
OS:                Linux (i686) release 2.6.27.19-3.2-pae

Fech cover locales and servers aren't assigned correctly because Canada is in the second place and will be the last.

As I can see using "amarok --debug" the asignation was:

International -> .com (ok)
Canada -> .fr (bad)
France -> .de (bad)
Germany -> .jp (bad)
Japan - .co.uk (bad)
U.K. -> .ca (bad)

pretty confusing :).
Comment 1 Mark Kretschmann 2009-03-30 08:57:36 UTC
Ouch. Does anyone know if this is still valid in SVN?

Ignacio, could you make a patch for fixing it?
Comment 2 Ignacio Serantes 2009-03-30 13:26:20 UTC
Well I'm not a C programmer and I don't know how to debug and trace a C program but my brain debugging tool shows me that the problem would be in CoverFech.h

85: enum Locale { International=0, France, Germany, Japan, UK, Canada };

because don't have the same order that combo and probably would be 

85: enum Locale { International=0, Canada, France, Germany, Japan, UK };

but could be not ;).

Locale are obtained in CoverFetcher.cpp

258: QString locale = AmarokConfig::amazonLocale();

but I'm not sure if with the enum change the problem will be fixed.

On the other side, there is a wrong comment in 259 "//Amazon Japan isn't on xml.amazon.com". If that comment would be true Amarok can't download covers from amazon.jp ;).
Comment 3 Myriam Schweingruber 2009-05-31 09:59:17 UTC
Waiting for info: does this still happen in Amarok 2.1?
Comment 4 Ignacio Serantes 2009-05-31 16:34:55 UTC
Yes, I need to use Germany to download covers from Japan. I test this in main interface and in "Cover Manager" form.
Comment 5 Myriam Schweingruber 2009-07-30 18:07:34 UTC
Confirmed with current 2.2-git. I suspect some weird sorting of the locations, the displayed list is only partially alphabetical as it starts with 'International'
Comment 6 Ignacio Serantes 2009-07-31 22:49:26 UTC
Well, I finally learn how to compile a Amarok. God, programing in C++ is really a nightmare :(, thanks god for my new dual core computer but, as I told in March a simple change fix the bug:

Change
enum Locale { International=0, France, Germany, Japan, UK, Canada };

for
enum Locale { International=0, Canada, France, Germany, Japan, UK };

and, for me, bug was fixed.
Comment 7 Myriam Schweingruber 2009-08-01 08:54:00 UTC
Could somebody fix this, please?
Comment 8 Mark Kretschmann 2009-08-01 15:04:28 UTC
commit cc4a2b4d352ab0b624363ad06e1c27efcc193096
Author: Mark Kretschmann <kretschmann@kde.org>
Date:   Sat Aug 1 15:00:21 2009 +0200

    Assign correct locales for Amazon servers.

    Thanks to Ignacio Serantes for figuring this out :)