[banshee: 20/57] In slow recursive browse, send chunks of 500 to be stored and displayed in GUI, this way it atleast



commit 6da9f6c3eea4f6e4909365e011259353d5cb059c
Author: Tobias Arrskog <topfs2 xbmc org>
Date:   Tue Jul 5 00:24:27 2011 +0200

    In slow recursive browse, send chunks of 500 to be stored and displayed in GUI, this way it atleast show that we are working and the user can use the tracks as they become available

 .../Banshee.UPnPClient/UPnPService.cs              |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPService.cs b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPService.cs
index e647f56..55c3cdc 100644
--- a/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPService.cs
+++ b/src/Extensions/Banshee.UPnPClient/Banshee.UPnPClient/UPnPService.cs
@@ -122,7 +122,9 @@ namespace Banshee.UPnPClient
                 }
             }
 
-            source.AddTracks (musicTracks);
+            if (musicTracks.Count > 0)
+                source.AddTracks (musicTracks);
+
             Hyena.Log.Debug ("Found all items on the service, took " + (DateTime.Now - begin).ToString());
         }
 
@@ -145,6 +147,11 @@ namespace Banshee.UPnPClient
                 else if (upnp_object is Container) {
                     ParseContainer (source, remoteContentDirectory, upnp_object as Container, depth + 1, musicTracks);
                 }
+
+                if (musicTracks.Count > 500) {
+                    source.AddTracks (musicTracks);
+                    musicTracks.Clear();
+                }
             }
         }
     



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