Bug 136833 - Context Browser doesn't show compilation cover images
Summary: Context Browser doesn't show compilation cover images
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Unclassified
Component: Context View (show other bugs)
Version: 1.4.4
Platform: Gentoo Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-04 18:24 UTC by Ypsilon
Modified: 2006-12-11 09:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
fixes cover storage/lookup of compilations (1.75 KB, patch)
2006-12-10 21:17 UTC, Tobias Knieper
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ypsilon 2006-11-04 18:24:51 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          gcc version 4.1.1 (Gentoo 4.1.1-r1) x86_64-pc-linux-gnu
OS:                Linux

When playing a song from a compilation, the Context Browser doesn't show the cover image of the compilation that the song belongs to although it has been set in the cover manager. The reason for that seems clear already. This is an example to explain:

You got a compilation named "Greatest Songs Ever". In the Cover Editor you have set the cover image for "Various Artists - Greatest Songs Ever" correctly.
When you play the song "Foo" by "The Bars" which is included in the "Greatest Songs Ever" compilation, the Context Browser is looking for a cover image assigned to the album "The Bars - Greatest Songs Ever" which doesn't exist of course. 
Therefore no cover image is being displayed.
Comment 1 Mark Kretschmann 2006-11-04 18:34:19 UTC
Which Amarok version?
Comment 2 Ypsilon 2006-11-05 16:53:15 UTC
I'm sorry I forgot that.

Component should be "Context Browser"
and version is 1.4.4.

I have also tried latest SVN.
Comment 3 Tobias Knieper 2006-11-05 20:12:43 UTC
The reason is that the cover is only assigned to the first track in the compilation.
Comment 4 Ypsilon 2006-11-05 21:57:54 UTC
But shouldn't then the first track of a compilation have the a cover image shown in the ContextBrowser?
Over here that is not the case, the first song is not handled in a different way compared to the others.

The CoverManager shows "Various Artists - [Name of compilation]" for the item that a compilation cover image blongs to, when you hover the thumbnail.
So I just assume that this is the name under which compilation cover images are saved and recognized.
Comment 5 Tobias Knieper 2006-11-05 22:13:01 UTC
Hmm, i assigned the cover via context browser: Expand the Various Artists group, right click on the compilation and then assign a cover. I tried this a few times and the cover gets always assigned to the first track of the compilation. Maybe this behavior is different from assigning the cover in the cover manager..?
Comment 6 Ypsilon 2006-11-05 22:51:32 UTC
I can't reproduce that over here with SVN version from this evening. Assigning a cover in the Collection Browser does not change anything. I also feel the storage of the cover images is already right and good as it is. It does of course make sense to save a compilation cover image under "Various Artists - [name of compilation]".
It's just the ContextBrowser which has apparently been forgotten to adjust to amarok's compilation recognizing support and therefore looks for the cover images under the wrong names.
Comment 7 Tobias Knieper 2006-12-10 21:17:57 UTC
Created attachment 18881 [details]
fixes cover storage/lookup of compilations

This patch changes the behavior of storing covers of compilations fetched from
amazon. the covers are now hashed by an empty artist (as they were already
looked up by findAmazonImage()). This patch does not affect the lookup of
directory covers.
Comment 8 Mark Kretschmann 2006-12-11 09:57:12 UTC
SVN commit 612402 by markey:

Improved cover images handling for Various Artists. Patch by Tobias Knieper <tobias.knieper@micekiller.de>.

This patch changes the behavior of storing covers of compilations fetched from 
amazon. the covers are now hashed by an empty artist (as they were already 
looked up by findAmazonImage()). This patch does not affect the lookup of 
directory covers.

BUG: 136833


 M  +2 -0      ChangeLog  
 M  +8 -5      src/collectiondb.cpp  


--- trunk/extragear/multimedia/amarok/ChangeLog #612401:612402
@@ -60,6 +60,8 @@
     * Amarok now saves playlists with relative paths by default.
 
   BUGFIXES:
+    * Improved cover images handling for Various Artists. Patch by Tobias
+      Knieper <tobias.knieper@micekiller.de>. (BR 136833)
     * Don't enable a mount point for devices that can't support them (mtp,
       njb).
     * With SQLite, the search in the collection browser was case-sensitive
--- trunk/extragear/multimedia/amarok/src/collectiondb.cpp #612401:612402
@@ -1849,17 +1849,20 @@
     //show a wait cursor for the duration
     Amarok::OverrideCursor keep;
 
+    const bool isCompilation = albumIsCompilation( QString::number( albumID( album, false, false, true ) ) );
+    const QString artist_ = isCompilation ? "" : artist;
+
     // remove existing album covers
-    removeAlbumImage( artist, album );
+    removeAlbumImage( artist_, album );
 
-    QCString key = md5sum( artist, album );
+    QCString key = md5sum( artist_, album );
     newAmazonReloadDate(asin, AmarokConfig::amazonLocale(), key);
     // Save Amazon product page URL as embedded string, for later retreival
     if ( !amazonUrl.isEmpty() )
         img.setText( "amazon-url", 0, amazonUrl );
 
     const bool b = img.save( largeCoverDir().filePath( key ), "PNG");
-    emit coverChanged( artist, album );
+    emit coverChanged( artist_, album );
     return b;
 }
 
@@ -1968,7 +1971,7 @@
     s = findAmazonImage( artist, album, width );
 
     if( s.isEmpty() )
-        s = findAmazonImage( "", album, width );
+        s = findAmazonImage( "", album, width ); // handle compilations
 
     if( s.isEmpty() )
         s = findDirectoryImage( artist, album, width );
@@ -2015,7 +2018,7 @@
     if( s.isEmpty() )
         s = findAmazonImage( artist, album, width );
     if( s.isEmpty() )
-        s = findAmazonImage( "", album, width );
+        s = findAmazonImage( "", album, width ); // handle compilations
     if( s.isEmpty() )
         s = findDirectoryImage( artist, album, width );
     if( s.isEmpty() )