banshee r5040 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Database src/Extensions/Banshee.AudioCd/Banshee.AudioCd



Author: gburt
Date: Tue Feb 17 20:00:07 2009
New Revision: 5040
URL: http://svn.gnome.org/viewvc/banshee?rev=5040&view=rev

Log:
2009-02-17  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs: Use
	the SortName information from MusicBrainz, and detect if an album is a
	compilation album and set the album and all the tracks appropriate if it
	is.

	* src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs: Set the
	FileModifiedStamp and LastSyncedStamp when a track is ripped.



Added:
   trunk/banshee/src/Core/Banshee.Services/Banshee.Database/SortKeyUpdater.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs
   trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs

Added: trunk/banshee/src/Core/Banshee.Services/Banshee.Database/SortKeyUpdater.cs
==============================================================================

Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs	Tue Feb 17 20:00:07 2009
@@ -156,7 +156,9 @@
             
             DatabaseArtistInfo artist = new DatabaseArtistInfo ();
             artist.Name = release.Artist.Name;
+            artist.NameSort = release.Artist.SortName;
             artist.MusicBrainzId = release.Artist.Id;
+            bool is_compilation = false;
             
             DatabaseAlbumInfo album = new DatabaseAlbumInfo ();
             album.Title = release.Title;
@@ -165,7 +167,7 @@
             album.ReleaseDate = release_date;
             
             i = 0;
-            
+
             foreach (Track track in release.Tracks) {
                 AudioCdTrackInfo model_track = (AudioCdTrackInfo)this[i++];
                 
@@ -174,15 +176,30 @@
                 model_track.ArtistName = track.Artist.Name;
                 model_track.AlbumTitle = release.Title;
                 model_track.DiscNumber = disc_number;
-                
                 model_track.Album = album;
+
                 model_track.Artist = new DatabaseArtistInfo ();
                 model_track.Artist.Name = track.Artist.Name;
+                model_track.Artist.NameSort = track.Artist.SortName;
                 model_track.Artist.MusicBrainzId = track.Artist.Id;
                 
                 if (!release_date.Equals (DateTime.MinValue)) {
                     model_track.Year = release_date.Year;
                 }
+
+                if (!is_compilation && track.Artist.Id != artist.MusicBrainzId) {
+                    is_compilation = true;
+                }
+            }
+
+            if (is_compilation) {
+                album.IsCompilation = true;
+                for (i = 0; i < release.Tracks.Count; i++) {
+                    AudioCdTrackInfo model_track = (AudioCdTrackInfo)this[i++];
+                    model_track.IsCompilation = true;
+                    model_track.AlbumArtist = artist.Name;
+                    model_track.AlbumArtistSort = artist.NameSort;
+                }
             }
             
             OnMetadataQueryFinished (true);

Modified: trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs	Tue Feb 17 20:00:07 2009
@@ -201,6 +201,8 @@
             track.Uri = args.Uri;
             
             track.FileSize = Banshee.IO.File.GetSize (track.Uri);
+            track.FileModifiedStamp = Banshee.IO.File.GetModifiedTime (track.Uri);
+            track.LastSyncedStamp = DateTime.Now;
             
             track.Save ();
 



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