Re: [Banshee-List] Cover art patch



On 1/28/06, Pepijn van de Geer <pvandegeer gmail com> 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;
>             }
>         }
>


Nice! I've been thinking about twisting banshee into doing this myself
for some time, but coding skills hardly match up to my ambitions...
I'll add it to my personal branch, including a search for the pretty
standard cover.jpg (used by cowbell among others).



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