GNOME Bugzilla – Bug 623828
eMusic: add store integration
Last modified: 2011-04-08 17:34:48 UTC
Created attachment 165470 [details] mime-info file defining application/x-emusic for *.emx Eitan's eMusic downloader plugin is very handy! It'd be even nicer if the .emx files were associated with Banshee properly. AFAICT, this involves adding a file to $prefix/share/mime/packages describing the application/x-emusic MIME type (a subclass of application/xml; I've attached the one I've tested with), and then including application/x-emusic to data/desktop-files/banshee-1.desktop.mime. I've not actually gone to the trouble of poking at the Banshee build system to arrange to install the former (and run update-mime-info on $prefix/share/mime, but I think that's the distro's job) so I don't have a patch attached. Also I haven't defined an icon for .emx files. I guess it should follow whatever icon was defined for Amazon's equivalent?
Yeah, do it like the amz files. Thanks! Please attach patch in `git format-patch` format.
I'm a little confused by this,Will. If i add the attachment to /usr/share/mime/packages. .emx files will be associated with banshee? I'm lost at the data/desktop-files/banshee-1.desktop.mime part. at the moment, when i'm trying to open an .emx file with banshee nothing happens. I have to manually import everything. can i get a step by step on how to resolve this?
I actually chose a slightly different approach, and wrote an Amazon store-style plugin for eMusic: http://cgit.freedesktop.org/~wjt/banshee/commit/?h=emusic-store In the process, I found that the MIME type actually used by eMusic is "application/vnd.emusic-emusic_list". I notice that there's a tiny command-line app for processing .amz files; I guess something similar could work for .emx files.
With Will's consent, I've asked the GNOME Foundation Board to create an affiliate account; it's in progress.
Some comments on the patch: 1) Can you change the addin URL to http://banshee.fm since it will be part of Banshee itself? 2) I think name="eMusic Store" is better than "eMusic Source" 3) Browse, search, and purchase music from eMusic => music and audiobooks 4) Add a System.Uri.EscapeDataString (query) to the search method 5) I've added a banshee.fm redirect, please use it: "http://integrated-services.banshee.fm/emusic/home/" "http://integrated-services.banshee.fm/emusic/search/" + Uri.EscapeDataString (query) 6) Add the .emx mimetype(s) to data/desktop-files/banshee.desktop.mime 7) We need the sign-out support. You can probably figure out which cookie determines if a user is signed in by visiting emusic.com, checking what cookies are there, then sign in, and see which ones have been changed/added.
I think Andreas is working on an icon.
Created attachment 183440 [details] 16x16 icon
Created attachment 183881 [details] [review] Add an eMusic web store pane. This is basically copy-pasta from the Amazon store, and uses the existing eMusic downloader plugin. It's lacking an icon, and doesn't detect being logged in or out.
Created attachment 183882 [details] [review] eMusic Store: Add a Signout link. This works a little differently to the Amazon version: because we don't have any other items in the menu, just hiding the item leaves us with an empty menu in the UI. If a similar page is added for eMusic, this could be made to work like Amazon.
Created attachment 183883 [details] [review] Amazon: fix signed-in detection for UK store.
Created attachment 183884 [details] [review] Add MIME type for eMusic's .emx files. Yeah, this really is the name of the MIME type they serve up.
Created attachment 183885 [details] [review] Enable eMusic downloader extension by default. If Banshee's desktop file says it can handle .emx files, then it should be able to do so by default. This does not enable the eMusic store plugin by default. Since eMusic is a subscription-only service it strikes me that this is a little more niche than, say, Amazon.
Hokay, I think I've addressed those points. I squashed the trivial ones into the initial patch. You'll presumably want to add a logout action to integrated-services. I noticed that online stores seem to be sorted case-sensitively and thus eMusic is above Amazon in the list, which looks weird. I couldn't see where the case-sensitive search was going on; I assumed that SourceSortType.cs was being used, but it seems only to be used for sorting playlists and the like, and it sorts case-insensitively anyway. So I leave this in the capable hands of someone more familiar with the codebase.
Thanks Will! I've pushed these all to master. I also added a .csproj and .sln entry, and added the appropriate files to po/POTFILES.in.