banshee r5003 - in trunk/banshee: . src/Dap/Banshee.Dap/Banshee.Dap



Author: gburt
Date: Tue Feb  3 20:50:39 2009
New Revision: 5003
URL: http://svn.gnome.org/viewvc/banshee?rev=5003&view=rev

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

	* src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs:
	* src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs: Patch from AndrÃs G.
	Aragoneses, moving the removal of DAP playlists from being called on each
	LibrarySync (eg once for Music, Video, etc) to the overall DapSync, fixing
	bug where playlists didn't sync to DAPs because they were deleted when the
	PodcastSource synced (BGO #560970)

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs

Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapLibrarySync.cs	Tue Feb  3 20:50:39 2009
@@ -204,9 +204,8 @@
                 }
 
                 if (library.SupportsPlaylists && sync.Dap.SupportsPlaylists) {
-                    sync.Dap.RemovePlaylists ();
-
-                    // Then create the playlists, taking snapshots of smart playlists and saving them
+                    
+                    // Now create the playlists, taking snapshots of smart playlists and saving them
                     // as normal playlists
                     IList<AbstractPlaylistSource> playlists = GetSyncPlaylists ();
                     foreach (AbstractPlaylistSource from in playlists) {

Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap/DapSync.cs	Tue Feb  3 20:50:39 2009
@@ -285,11 +285,28 @@
         private void RateLimitedSync ()
         {
             syncing = true;
+
+            bool sync_playlists = false;
+            if (dap.SupportsPlaylists) {
+                foreach (DapLibrarySync library_sync in library_syncs) {
+                    if (library_sync.Library.SupportsPlaylists) {
+                        sync_playlists = true;
+                        break;
+                    }
+                }
+            }
             
+            if (sync_playlists) {
+                dap.RemovePlaylists ();
+            }
+
             foreach (DapLibrarySync library_sync in library_syncs) {
                 library_sync.Sync ();
             }
-            dap.SyncPlaylists ();
+
+            if (sync_playlists) {
+                dap.SyncPlaylists ();
+            }
 
             syncing = false;
         }



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