Re: [Banshee-List] Cover art patch



personally, i would like to see c) first. i mean, if a user has the cover art already in the folder (its probably correct), and, why send time trying to go find it from amazon/musicbrainz.

but thats just me personally. I have art for most of my music in the ID3 tag AND folder.jpg files, so, seeing this support come in would be great for the albums that aren't found automatically.
On Feb 8, 2006, at 1:15 AM, Aaron Bockover wrote:

I just wrote up a patch for this, loosely based off this code.
Functionally it differs as such:

a) The ASIN cover art in the Banshee cover art location is checked first
b) The ASIN is used to see if an actual amazon-downloaded cover is in
the song's directory
c) Finally check for {[Cc]over,[Ff]older}.{jpg,png,jpeg,gif}, in that
order

Additionally, if a cover is found, its location is cached for the
session.

I'm thinking that maybe the "cover.jpg" check should be first, though
I'd like to think MusicBrainz is always accurate (which it is not :-).
Any thoughts?

For the sake of discussion, I've attached the patch, but it's already
committed.

Also, Pepijn, for future reference, you can create patches against a CVS checkout, from the *top* of the checkout (i.e. where you see autogen.sh,
configure, etc.):

$ cvs diff -u > mypatch.diff

That will create a patch for any file that differs from what's in the
repo.

cvs diff -u src/Banshee.Base/TrackInfo.cs > TrackInfo.cs-coverart.diff

You can specify files which you only want included in the diff, as I did
to create the attached patch (since I have many other files that differ
locally and are not part of this patch).

If you're working from a tarball, you need to copy the original file
("cp TrackInfo.cs TrackInfo.cs.orig") and then use diff directly ("diff
-u TrackInfo.cs.orig TrackInfo.cs"). However, patches against CVS are
preferred.

Thanks!
--Aaron


On Sat, 2006-01-28 at 22:58 +0100, Pepijn van de Geer wrote:
Hi all,

First, I really like the Metadata plugin. But unfortunetly it only
finds the cover art for some of my files. Mostly because of Amazon.
They don't stock much foreign albums, so all local (dutch) artists
don't get covers. Since i have coverart for almost every album present
in the folders allready i decided to make Banshee use them.
I added a few lines to the CoverArtFileName in the TrackInfo class. I
don't knwo how to create a .patch file, so here it is. This can be
easily extended to all kinds of filenames, but this catches most of
them.

        public string CoverArtFileName {
            get {
                string basepath =
System.IO.Path.GetDirectoryName(Uri.LocalPath) +
System.IO.Path.DirectorySeparatorChar;
                if (System.IO.File.Exists (basepath + "folder.jpg")) {
                    return basepath + "folder.jpg";
                }
                if (System.IO.File.Exists(basepath + "folder.gif")) {
                    return basepath + " folder.gif";
                }
                if (System.IO.File.Exists(basepath + "front.jpg")) {
                    return basepath + "front.jpg";
                }
                if ( System.IO.File.Exists(basepath + "front.gif")) {
                    return basepath + "front.gif";
                }
                if (System.IO.File.Exists(basepath + asin +
".01._SCLZZZZZZZ_.jpg")) {
                    return basepath + asin + ".01._SCLZZZZZZZ_.jpg";
                }
                string path = Paths.GetCoverArtPath(asin);
                if(System.IO.File.Exists(path)) {
                    return path;
                }
                return null;
            }
        }

Cheers,
Pepijn
_______________________________________________
Banshee-list mailing list
Banshee-list gnome org
http://mail.gnome.org/mailman/listinfo/banshee-list
<TrackInfo.cs- coverart.diff>_______________________________________________
Banshee-list mailing list
Banshee-list gnome org
http://mail.gnome.org/mailman/listinfo/banshee-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]