banshee r4531 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection.Indexer



Author: abock
Date: Fri Sep 12 03:59:20 2008
New Revision: 4531
URL: http://svn.gnome.org/viewvc/banshee?rev=4531&view=rev

Log:
2008-09-11  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexerService.cs:
    * src/Core/Banshee.Services/Banshee.Collection.Indexer/ICollectionIndexerService.cs:
    Split HasCollectionChanged method to HasCollectionCountChanged and
    HasCollectionLastModifiedChanged methods



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexerService.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/ICollectionIndexerService.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexerService.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexerService.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/CollectionIndexerService.cs	Fri Sep 12 03:59:20 2008
@@ -114,7 +114,8 @@
             }
         }
         
-        public bool HasCollectionChanged (int count, long time)
+        
+        public bool HasCollectionCountChanged (int count)
         {
             lock (this) {
                 int total_count = 0;
@@ -124,10 +125,15 @@
                     total_count += library.Count;
                 }
                 
-                if (count != total_count) {
-                    return true;
-                }
-                
+                return count != total_count;
+            }
+        }
+        
+        public bool HasCollectionLastModifiedChanged (int time)
+        {
+            lock (this) {
+                long last_updated = 0;
+
                 foreach (LibrarySource library in libraries) {
                     last_updated = Math.Max (last_updated, ServiceManager.DbConnection.Query<long> (
                         String.Format ("SELECT MAX(CoreTracks.DateUpdatedStamp) {0}",

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/ICollectionIndexerService.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/ICollectionIndexerService.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Indexer/ICollectionIndexerService.cs	Fri Sep 12 03:59:20 2008
@@ -43,6 +43,7 @@
         void Shutdown ();
         ObjectPath CreateIndexer ();
         string [] GetAvailableExportFields ();
-        bool HasCollectionChanged (int count, long time);
+        bool HasCollectionCountChanged (int count);
+        bool HasCollectionLastModifiedChanged (int time);
     }
 }



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