Bug 91044 - Wish : show album picture instead of a CD in the collection
Summary: Wish : show album picture instead of a CD in the collection
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 1.1.1
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 123544 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-10 10:05 UTC by pierre
Modified: 2007-03-09 18:58 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to show album images in collection browser (1.50 KB, patch)
2006-12-11 22:20 UTC, Torrie Fischer
Details
Preview of the patch's effects (123.72 KB, image/png)
2006-12-12 12:55 UTC, Torrie Fischer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierre 2004-10-10 10:05:55 UTC
Version:           1.1.1 (using KDE 3.3.0,  (3.1))
Compiler:          gcc version 3.3.4 (Debian 1:3.3.4-12)
OS:                Linux (i686) release 2.6.7-1-k7

Actually, in the library, the albums are shown with a common picture (a small CD)
It would be very nice to see it with the album cover when available...
And on mouse over, show the picture bigger for instance...
Comment 1 Flo Haug 2005-03-03 17:23:14 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 Andreas Heinz 2005-08-03 22:14:53 UTC
since this was reported for version 1.1.1 and i'm using amarok since version 1.2, i didnt even sse amarok without this feature.
bug resolved i think
Comment 3 pierre 2005-08-03 22:17:43 UTC
Since I'm using amarok 1.3 beta 3, and this feature still doesn't exist (for instance the CDs shown in the collection tree for instance are still icons), I think this bug isn't solved !
Comment 4 Andreas Heinz 2005-08-03 22:21:05 UTC
@pierre: sorry i did get you wrong. didnt realise that you mean the collection tree with "collection" in your topic.

so i agree, your wish isnt solved yet.
as i just had a look at the collection tree, the album pics would be a little bit small, or if shown with lets say 100x100 the tree would become quite big, with many albums in the tree.
so this should be optional i think
Comment 5 Ian Monroe 2005-08-03 23:51:46 UTC
Perhaps there could be a view like what Muine has (never used it, but I've seen the screenshots), a list of all the albums with their cover art at like 60x60.
Comment 6 Seb Ruiz 2006-08-31 11:17:50 UTC
*** Bug 123544 has been marked as a duplicate of this bug. ***
Comment 7 Torrie Fischer 2006-12-11 22:20:49 UTC
Created attachment 18891 [details]
Patch to show album images in collection browser

Neat idea. I have a patch here that adds the requested functionality, however I
do not have commit access. I find that, for best results, you should reduce
preview size from 100px to 75px.

Cheers.
Comment 8 Nicolas Dietrich 2006-12-12 00:33:54 UTC
Trever - I tried to apply your patch, and amarok still compiles ;-)

But how do I actually use it? (As far as I can see, your patch just adds the setPixmap function - shouldn't that function be called at some place??)

Nico
Comment 9 Torrie Fischer 2006-12-12 01:03:04 UTC
Nico, when amarok builds the list in the collection browser, it calls setPixmap() on each CollectionItem, with a pixmap generated from another function that returns the appropriate icon for an album (CD), artist (people), or genre (filing cabinet). My patch extends Qt's own setPixmap() function by checking to see if the category the CollectionItem is assigned to (set in the constructor) is that of an Album. If so, it queries the database to find any artist with that album. I just now noticed that I put the code in the wrong place in the file, but you can see the function my modified setPixmap() is above is the function that fetches album images in the right click menu.
Comment 10 richlv 2006-12-12 09:00:55 UTC
sounds neat. maybe you can attach a screenshot of this in action ?
Comment 11 Torrie Fischer 2006-12-12 12:55:52 UTC
Created attachment 18899 [details]
Preview of the patch's effects
Comment 12 richlv 2006-12-12 13:03:16 UTC
looks nice, though i am sure i would like images to be much smaller.
Comment 13 Nicolas Dietrich 2006-12-12 13:40:27 UTC
I see - you're overriding QT's own method. Unfortunately after rebuilding the collection, Amarok does not start anymore. (I used current SVN version of Amarok)

What do you mean with:
"I just now noticed that I put the code in the wrong place in the file, but you can see the function my modified setPixmap() is above is the function that fetches album images in the right click menu."
Comment 14 Mark Kretschmann 2006-12-12 17:34:18 UTC
SVN commit 612787 by markey:

Show album covers in collection browser. Experimental patch by Trever Fischer <wm161@wm161.net>.

I think this is pretty cool. Maybe we should limit size of the images though?

BUG: 91044
CCMAIL: amarok@kde.org


 M  +19 -0     collectionbrowser.cpp  
 M  +2 -0      collectionbrowser.h  


--- trunk/extragear/multimedia/amarok/src/collectionbrowser.cpp #612786:612787
@@ -1490,7 +1490,26 @@
     }
 }
 
+void
+CollectionItem::setPixmap(int column, const QPixmap & pix)
+{
+    if ( m_cat == IdAlbum ) {
+        QString album = text(0);
+        QStringList values =
+            CollectionDB::instance()->query ( QString (
+                "SELECT DISTINCT artist.name FROM artist, album, tags "
+                "WHERE artist.id = tags.artist AND tags.album = album.id "
+                "AND album.name = '%1';" )
+                .arg( CollectionDB::instance()->escapeString( album ) ) );
+        if ( !values.isEmpty() )
+            QListViewItem::setPixmap( column, QPixmap( CollectionDB::instance()->albumImage( values[0], album ) ) );
+        else
+            QListViewItem::setPixmap( column, QPixmap( CollectionDB::instance()->notAvailCover() ) );
+    } else
+        QListViewItem::setPixmap( column, pix );
+}
 
+
 void
 CollectionView::fetchCover() //SLOT
 {
--- trunk/extragear/multimedia/amarok/src/collectionbrowser.h #612786:612787
@@ -165,6 +165,8 @@
         inline bool isUnknown() {return m_isUnknown;}
         inline bool isSampler() {return m_isSampler;}
 
+        virtual void setPixmap(int column, const QPixmap & pix);
+
         static QPixmap *star();
         static QPixmap *smallStar();
 
Comment 15 Nicolas Dietrich 2006-12-12 23:24:14 UTC
My problems (not responding anymore on startup) disappeared with the current svn version.

Great patch, Trever! And thanks for integrating, markey!
Comment 16 Peter de Kraker 2006-12-12 23:26:47 UTC
Great to see somebody made this happen! Thanks for the efforts!
Comment 17 richlv 2006-12-13 09:44:01 UTC
current implementation looks nice - but expanding entries with a large amount of sub-albums is delayed (probably while appropriate images are generated/found). during this time no indication that the click has been registered is shown.
expanding "various artists" (second time) takes some 4-5 seconds here.

maybe it is possible to background image loading and display them in the expanded tree as they are loaded ?
if not, a busy cursor or some other indication of what is happening would be nice (though i prefer first solution, if technically feasible, as currently collection browsing is kinda slow).

also filtering happens much slower (again with only 'various artists' expanded search for a single character takes ~ 3 seconds, with it collapsed it happens instantly) - it seems that images are re-loaded after each search.
Comment 18 Olaf Gladis 2007-03-09 18:58:24 UTC
great, i would like this, maybe with an option to enable / disable this and set the size. 
i didn't try the patch but the screenshoot look great. and if there is an option only to show pictures for covers you have, not blank cds