Bug 170146 - Albums with same title share cover (last added)
Summary: Albums with same title share cover (last added)
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Tools/Cover Manager (show other bugs)
Version: 2.3-GIT
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 2.3.1
Assignee: Amarok Developers
URL:
Keywords: needs_verification
: 143361 191411 196122 198491 213766 214572 229804 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-31 20:12 UTC by Victor Suarez
Modified: 2010-03-19 08:38 UTC (History)
13 users (show)

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 Victor Suarez 2008-08-31 20:12:33 UTC
Version:            (using KDE 4.1.1)
OS:                Linux
Installed from:    Ubuntu Packages

Kubuntu 8.04.1, with KDE 4.1.1 and amarok-nightly packages.

In Amarok 2, albums with same title share the same cover (last added). This happened with Amarok 1.x too. Typically with "Greatest Hits" albums (almost every group has one).
Comment 1 Greg 2008-09-02 00:31:40 UTC
I think the underlying bug is that an entry is made to the album database only for unique album titles. Two different albums that have the same name (most notably "Greatest Hits") reuse one album database record. For me, this manifests itself when I look at the total album count in my collection which is less than the actual album count. This lower count is the same number as entries in the album database.
Comment 2 Mark Kretschmann 2008-10-02 19:04:05 UTC
Well this isn't a bug, but done by design, as Greg explained. The hash for each cover is "artist + album".
Comment 3 Victor Suarez 2008-10-02 19:38:23 UTC
Well, if the hash for each cover were "artist + album", then there will be no problem, but I think the hash is actually "album" (remove "artist +").
Comment 4 Victor Suarez 2008-10-03 16:20:26 UTC
Sorry for reopening the bug.

Mark, if the criteria for assigning covers to files is the hash produced from "artist + album", then "Queen + Greatest Hits"'s hash must be different to "Bob Seger + Greatest Hits"'s one, and this is not happening. If you say the hash is calculated only from "album", then the bug can be closed and I will open a new "wishlist" report.
Comment 5 Victor Suarez 2008-11-15 13:09:10 UTC
Will this bug be fixed before Amarok 2 final release launch? 
Comment 6 Mark Kretschmann 2008-11-15 14:48:38 UTC
@Victor: Unlikely, we already got our hands full with more important stuff. Very very busy times.
Comment 7 Dan Meltzer 2008-12-03 18:33:06 UTC
Not going to happen for 2.0, sorry.  This is not a new regression, and while it should be fixed, there is not enough time for everything.

Targetting it for down-the-road.
Comment 8 Dmitry Zhurikhin 2009-02-05 14:54:58 UTC
Hello.  I don't know if it is better to open a new bug for what I am experiencing but after reading this thread it seems that it is connected.
My problem is that I've got a collection of MP3's without Album tag set.  And when I try to set a cover for the file without such tag it is showed as some other cover in playlist (apparently last manually added cover for another track without album tag).  Though cover manger fetches and shows the right cover.  After learning that the hash for cover is only composed from the album tag I tried to remove cover from the track and fill in its album tag.  After this I fetched its cover again and saved it - now playlist shows the right cover.  Removing the cover and album tag and fetching cover again results in showing the wrong cover again.  I think it is not a correct behaviour.  
If there is no hope that it will be corrected soon, I'd try to do it myself.  Then please give me some guidance of where to look to implement the correct solution.
Comment 9 Myriam Schweingruber 2009-04-24 12:29:44 UTC
I'm just wondering why this bug is still marked as being 'unconfirmed'...
Comment 10 Myriam Schweingruber 2009-06-12 08:46:19 UTC
*** Bug 196122 has been marked as a duplicate of this bug. ***
Comment 11 Alexey Shildyakov 2009-06-23 01:27:15 UTC
*** Bug 191411 has been marked as a duplicate of this bug. ***
Comment 12 Alexey Shildyakov 2009-06-23 01:28:50 UTC
*** Bug 143361 has been marked as a duplicate of this bug. ***
Comment 13 doc.evans 2009-07-09 16:12:32 UTC
My experience is that this is a new bug in Amarok 2 :-) 

I have several albums called "Classics", Greatest Hits", "Best of" &c. In Amarok 1.4 all the covers were fine (here). But in Amarok 2.1 there is only one cover for each title.

Anyway, I guess it doesn't really matter whether the bug is old or new; it definitely exists.
Comment 14 Myriam Schweingruber 2009-07-09 18:44:49 UTC
Set target to 2.2
Comment 15 Myriam Schweingruber 2009-07-09 18:47:24 UTC
Changed importance to normal.
Comment 16 Myriam Schweingruber 2009-07-16 10:20:24 UTC
*** Bug 198491 has been marked as a duplicate of this bug. ***
Comment 17 Myriam Schweingruber 2009-08-09 15:53:03 UTC
One month later... any news?
Comment 18 Greg 2009-08-09 18:20:45 UTC
I haven't seen any resolution to this. I've seen various messages moving the status to "future release" or whatever. Did I miss a patch? I'd be happy to test something out.

-----Original Message-----
From: bugzilla_noreply@kde.org [mailto:bugzilla_noreply@kde.org]On
Behalf Of Myriam Schweingruber
Sent: Sunday, August 09, 2009 7:53 AM
To: iskimj@gmail.com
Subject: [Bug 170146] Albums with same title share cover (last added)


https://bugs.kde.org/show_bug.cgi?id=170146


Myriam Schweingruber <kde@pharma-traduction.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.0-SVN                     |2.2-GIT




--- Comment #17 from Myriam Schweingruber <kde pharma-traduction ch>  2009-08-09 15:53:03 ---
One month later... any news?
Comment 19 Myriam Schweingruber 2009-10-14 10:26:40 UTC
(In reply to comment #18)
> I haven't seen any resolution to this. I've seen various messages moving the
> status to "future release" or whatever. Did I miss a patch? I'd be happy to
> test something out.

Greg, I am also waiting for the developers to get into that, they are just very busy
Comment 20 Myriam Schweingruber 2009-11-09 11:09:12 UTC
*** Bug 213766 has been marked as a duplicate of this bug. ***
Comment 21 Myriam Schweingruber 2009-11-15 21:21:25 UTC
*** Bug 214572 has been marked as a duplicate of this bug. ***
Comment 22 Myriam Schweingruber 2010-03-07 20:31:10 UTC
*** Bug 229804 has been marked as a duplicate of this bug. ***
Comment 23 Mark Fraser 2010-03-08 16:16:15 UTC
So are you saying that the file names of the album covers are md5sums of the album title preceded by the dimensions of the image?
Comment 24 Myriam Schweingruber 2010-03-08 16:46:54 UTC
(In reply to comment #23)
> So are you saying that the file names of the album covers are md5sums of the
> album title preceded by the dimensions of the image?

Mark, whom are you talking to?
Comment 25 Rick W. Chen 2010-03-19 08:38:47 UTC
commit 4b2abed2810ec849ddb6ef80616e4e7fc44a778a
Author: Rick W. Chen <stuffcorpse@archlinux.us>
Date:   Fri Mar 19 17:09:34 2010 +1300

    meta: album: use image location as primary key for bordered pixmap cache
    
    BUG: 170146
    
    The name of the album can be ambiguous, especially for compilations such
    as "Greatest Hits", "Best of" etc. This causes the bordered pixmap cache
    to store only the first album's cover, and subsequent albums with the
    same name trying to retrieve their covers from the cache will use that
    for display. The name is now a fallback if location is empty.

diff --git a/ChangeLog b/ChangeLog
index e4c868b..7363350 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,8 @@ VERSION 2.3.1-Beta 1
        some MySQL versions. (BR 225052)
 
   BUGFIXES:
+     * Fixed incorrectly displayed cover images for albums with the same name,
+       e.g. "Greatest Hits". (BR 170146)
      * Fix permission errors happening for each file copied to an iPhone via ifuse.
        Thank you to Colin Guthrie <cguthrie@mandriva.org> for the patch. (BR 231021)
      * Fix issues with using random navigators while filetering or searching The
diff --git a/src/meta/Meta.cpp b/src/meta/Meta.cpp
index 44bc626..b58296c 100644
--- a/src/meta/Meta.cpp
+++ b/src/meta/Meta.cpp
@@ -451,9 +451,10 @@ QPixmap
 Meta::Album::imageWithBorder( int size, int borderWidth )
 {
     const int imageSize = size - ( borderWidth * 2 );
+    const QString loc   = imageLocation( imageSize ).url();
+    const QString key   = !loc.isEmpty() ? loc : name();
     const QPixmap cover = image( imageSize );
-    const QString &nameForKey = name();
-    return The::svgHandler()->addBordersToPixmap( cover, borderWidth, nameForKey );
+    return The::svgHandler()->addBordersToPixmap( cover, borderWidth, key );
 }