[banshee] Services: Prevent null LastSyncedStamp (bgo#631207)



commit 310bfbddf066d19bdebf2f7fe3d3348a1650d1cb
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Sat Dec 18 21:27:25 2010 +0100

    Services: Prevent null LastSyncedStamp (bgo#631207)
    
    Recent changes developed for enhancement bug 589196 enabled
    removable sources to obtain changes from the SaveMetadataJob,
    which exposed a bug on how their tracks were created: the
    LastSyncedStamp remained null for all of them, so when firing
    a metadata change on the source, all tracks would get updated
    and CPU could spike to 100%. This wasn't happening in tracks
    of local sources because when tracks are created in this case
    the importing algorithms updated this field accordingly (but
    actually if the update was done in a slow computer and the
    difference between the first DateTime.Now and the second one
    calculated in the Save() method was considerable, it could
    also mean that the difference between them triggered unneeded
    file updates, so this commit fixes that potential problem too).

 .../DatabaseTrackInfo.cs                           |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
index d9e5a99..f4d65e9 100644
--- a/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
+++ b/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
@@ -209,7 +209,7 @@ namespace Banshee.Collection.Database
 
             bool is_new = (TrackId == 0);
             if (is_new) {
-                DateAdded = DateUpdated = DateTime.Now;
+                LastSyncedStamp = DateAdded = DateUpdated = DateTime.Now;
             }
 
             ProviderSave ();



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