Summary: | Wish : show album picture instead of a CD in the collection | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | pierre <pierre.linux59> |
Component: | general | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | andi, peterdekraker, richlv, tdfischer |
Priority: | NOR | ||
Version: | 1.1.1 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Patch to show album images in collection browser
Preview of the patch's effects |
Description
pierre
2004-10-10 10:05:55 UTC
*** This bug has been confirmed by popular vote. *** 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 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 ! @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 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. *** Bug 123544 has been marked as a duplicate of this bug. *** 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.
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 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. sounds neat. maybe you can attach a screenshot of this in action ? Created attachment 18899 [details]
Preview of the patch's effects
looks nice, though i am sure i would like images to be much smaller. 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." 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(); My problems (not responding anymore on startup) disappeared with the current svn version. Great patch, Trever! And thanks for integrating, markey! Great to see somebody made this happen! Thanks for the efforts! 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. 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 |