[banshee] [dap] Let the user know if syncing a missing file



commit 15bfd6d5c1185590470262a1fe42538364967cb7
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Thu Jan 28 19:04:39 2010 -0800

    [dap] Let the user know if syncing a missing file
    
    Fixes bgo#608404
    
    Signed-off-by: Gabriel Burt <gabriel burt gmail com>

 src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs b/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
index 50df0fb..fa93b70 100644
--- a/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
+++ b/src/Dap/Banshee.Dap/Banshee.Dap/DapSource.cs
@@ -28,6 +28,7 @@
 //
 
 using System;
+using System.IO;
 using System.Collections.Generic;
 using System.Threading;
 using Mono.Unix;
@@ -316,8 +317,12 @@ namespace Banshee.Dap
 
         private void AttemptToAddTrackToDevice (DatabaseTrackInfo track, SafeUri fromUri)
         {
+            if (!Banshee.IO.File.Exists (fromUri)) {
+                throw new FileNotFoundException (Catalog.GetString ("File not found"), fromUri.ToString ());
+            }
+
             // Ensure there's enough space
-            if (Banshee.IO.File.Exists (fromUri) && BytesAvailable - Banshee.IO.File.GetSize (fromUri) >= 0) {
+            if (BytesAvailable - Banshee.IO.File.GetSize (fromUri) >= 0) {
                 // Ensure it's not already on the device
                 if (ServiceManager.DbConnection.Query<int> (track_on_dap_query, DbId, track.MetadataHash) == 0) {
                     AddTrackToDevice (track, fromUri);



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