[banshee/stable-1.8] LibraryWatcher: Don't watch non-existing dirs (bgo#638070)



commit e5ffe993d57e0f489734fb720c1a66bb980feb93
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date:   Sat Jan 29 21:17:12 2011 +0800

    LibraryWatcher: Don't watch non-existing dirs (bgo#638070)

 .../LibraryWatcherService.cs                       |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/LibraryWatcherService.cs b/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/LibraryWatcherService.cs
index 05a5d2d..6e7558e 100644
--- a/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/LibraryWatcherService.cs
+++ b/src/Extensions/Banshee.LibraryWatcher/Banshee.LibraryWatcher/LibraryWatcherService.cs
@@ -114,9 +114,13 @@ namespace Banshee.LibraryWatcher
             lock (watchers) {
                 if (!watchers.ContainsKey (library)) {
                     try {
-                        watchers[library] = new SourceWatcher (library);
-                        Hyena.Log.DebugFormat ("Started LibraryWatcher for {0} ({1})",
-                            library.Name, library.BaseDirectoryWithSeparator);
+                        var dir = library.BaseDirectoryWithSeparator;
+                        if (!Banshee.IO.Directory.Exists (dir)) {
+                            Hyena.Log.DebugFormat ("Skipped LibraryWatcher for {0} ({1})", library.Name, dir);
+                        } else {
+                            watchers[library] = new SourceWatcher (library);
+                            Hyena.Log.DebugFormat ("Started LibraryWatcher for {0} ({1})", library.Name, dir);
+                        }
                     } catch (Exception e) {
                         Hyena.Log.Exception (e);
                     }



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