~cszikszoy/do-plugins/pastebin

« back to all changes in this revision

Viewing changes to Rhythmbox/src/Rhythmbox.cs

  • Committer: David Siegel
  • Date: 2008-11-19 16:53:05 UTC
  • Revision ID: david@dell-desktop-20081119165305-eumipcmzffjabp33
Woohoo. Album cover art is back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
using System.Diagnostics;
26
26
using System.Collections.Generic;
27
27
 
 
28
using Banshee.Base;
 
29
 
28
30
using Do;
29
31
 
30
32
namespace Do.Rhythmbox
33
35
        public static class Rhythmbox
34
36
        {
35
37
                static readonly string MusicLibraryFile;
36
 
                static readonly string CoverArtDirectory;
37
38
 
38
39
                static ICollection<SongMusicItem> songs;
39
40
 
43
44
                static Rhythmbox ()
44
45
                {
45
46
                        MusicLibraryFile = Paths.Combine (Paths.UserHome, ".gnome2/rhythmbox/rhythmdb.xml");
46
 
                        CoverArtDirectory = Paths.Combine (Paths.UserHome, ".gnome2/rhythmbox/covers");
47
47
 
48
48
                        clear_songs_timer = new Timer (state =>
49
49
                                Gtk.Application.Invoke ((sender, args) => songs.Clear ())
131
131
                                                
132
132
                                                reader.ReadToFollowing ("date");
133
133
                                                year = reader.ReadString ();
134
 
                                
135
 
                                                cover = string.Format ("{0} - {1}.jpg", artist_name, album_name);
136
 
                                                cover = Path.Combine (CoverArtDirectory, cover);
137
 
                                                if (!File.Exists (cover)) cover = null;
 
134
 
 
135
                                                cover = CoverArtSpec.CoverExists (artist_name, album_name)
 
136
                                                        ? CoverArtSpec.GetPath (CoverArtSpec.CreateArtistAlbumId (artist_name, album_name))
 
137
                                                        : null;
138
138
 
139
139
                                                song = new SongMusicItem (song_name, artist_name, album_name, year, cover, song_file, song_track);
140
140
                                                songs.Add (song);