banshee r3474 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Library



Author: gburt
Date: Tue Mar 18 17:40:51 2008
New Revision: 3474
URL: http://svn.gnome.org/viewvc/banshee?rev=3474&view=rev

Log:
2008-03-18  Gabriel Burt  <gabriel burt gmail com>

	* src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs: Fix delete
	from library code so that remove tracks from database is only called once
	per Range.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Library/LibrarySource.cs	Tue Mar 18 17:40:51 2008
@@ -57,13 +57,13 @@
         
         protected override void DeleteTrackRange (TrackListDatabaseModel model, RangeCollection.Range range)
         {
+            // Remove from file system
             for (int i = range.Start; i <= range.End; i++) {
                 DatabaseTrackInfo track = model [i] as DatabaseTrackInfo;
                 if (track == null)
                     continue;
 
                 try {
-                    // Remove from file system
                     try {
                         Banshee.IO.Utilities.DeleteFileTrimmingParentDirectories (track.Uri);
                     } catch (System.IO.FileNotFoundException) {
@@ -72,10 +72,10 @@
                 } catch (Exception e) {
                     ErrorSource.AddMessage (e.Message, track.Uri.ToString ());
                 }
-
-                // Remove from database
-                RemoveTrackRange (model, range);
             }
+
+            // Remove from database
+            RemoveTrackRange (model, range);
         }
 
         public override bool AcceptsInputFromSource (Source source)



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