After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 534954 - Add ability to download cover art for entire library
Add ability to download cover art for entire library
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Linux
: Normal enhancement
: 1.0
Assigned To: Banshee Maintainers
Banshee Maintainers
: 532264 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-05-26 18:36 UTC by James Willcox
Modified: 2008-06-02 23:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which implements these features via an extension (19.05 KB, patch)
2008-05-26 18:36 UTC, James Willcox
reviewed Details | Review
Patch which hopefully includes all of Gabriel's suggestions (20.34 KB, patch)
2008-05-26 22:31 UTC, James Willcox
none Details | Review
Another iteration of the patch (20.17 KB, patch)
2008-05-27 21:17 UTC, James Willcox
none Details | Review
Yet another iteration of the patch (21.41 KB, patch)
2008-05-27 22:20 UTC, James Willcox
accepted-commit_now Details | Review
Another couple of fixes (22.20 KB, patch)
2008-05-28 15:56 UTC, James Willcox
committed Details | Review

Description James Willcox 2008-05-26 18:36:11 UTC
It should be possible to download cover art for the entire library at once instead of just getting it when a track is played.  Additionally, I think it would be nice if cover art was automatically fetched when new tracks were imported or if track information was changed.
Comment 1 James Willcox 2008-05-26 18:36:55 UTC
Created attachment 111561 [details] [review]
Patch which implements these features via an extension
Comment 2 Gabriel Burt 2008-05-26 20:14:58 UTC
Looks really good.  Just a bunch of nitpicks:

Fix up copyright header for CoverArtJob.cs.  Use last_scan instead of lastScan for private members, and lastScan for public method attribute names (you have them flipped).  Use @"my multiline string" instead of "" + "".  Probably a good idea to capitalize the SQL (eg select => SELECT) - I know I gave you the lowercase version, sorry.  Since you're now joining with CoreTracks, you should select distinct(CoreAlbums.AlbumID).

Does it make sense to limit the query to just the MusicLibrary?  If so, just need to add AND PrimarySourceID = ?", MusicLibrary.DbId.

If tracks.Count == 0, you call Finish, but without the Application.Invoke you use later.  We generally use Banshee.Base.ThreadAssist.ProxyToMain to execute delegates on the main loop, if that's what you're doing.

I think instead of listening for services starting waiting for InterfaceActionService, you can just add a dependency in the addins.xml file.  Ideally would be able to do that for the MusicLibrarySource too, but...I think the way things are setup, it would require changes to more Core stuff.
Comment 3 James Willcox 2008-05-26 22:31:36 UTC
Created attachment 111572 [details] [review]
Patch which hopefully includes all of Gabriel's suggestions
Comment 4 Gabriel Burt 2008-05-27 20:26:13 UTC
*** Bug 532264 has been marked as a duplicate of this bug. ***
Comment 5 James Willcox 2008-05-27 21:17:28 UTC
Created attachment 111630 [details] [review]
Another iteration of the patch

This version of the patch fixes some minor bugs and formatting issues.  It also fixes a problem with the Rhapsody metadata provider being awfully slow sometimes (it was leaking the WebResponse in cases where an invalid result was returned).
Comment 6 James Willcox 2008-05-27 22:20:47 UTC
Created attachment 111636 [details] [review]
Yet another iteration of the patch

This time there are some performance improvements -- it only keeps 10 tracks at a time in memory, and uses the same TrackInfo instance for all of them.  Previously every track was loaded into memory.
Comment 7 Gabriel Burt 2008-05-28 00:22:34 UTC
Looks great to me.  Assuming abock is fine w/ it, go ahead and commit.
Comment 8 James Willcox 2008-05-28 15:56:59 UTC
Created attachment 111665 [details] [review]
Another couple of fixes
Comment 9 jon cosby 2008-06-01 19:54:44 UTC
What is "CoverArtMenu.xml"? It's referenced as a resource but I can't find it and Banshee crashes on a TargetInvocationException:

Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: resource must be a valid resource name of 'assembly'.
  at Gtk.UIManager.AddUiFromResource (System.String resource) [0x00000]
  at Banshee.CoverArt.CoverArtService.Initialize () [0x000a5] in /home/jon/Projects/gtk/banshee/src/Extensions/Banshee.CoverArt/CoverArtService.cs:116

Line 116 is 

ui_manager_id = action_service.UIManager.AddUiFromResource ("CoverArtMenu.xml");

There are references to it in the patch but the file isn't there. 
Comment 10 jon cosby 2008-06-02 23:43:48 UTC
I see this has been added to RC1. The problem seems to have been taken care of there.