Skip to content
This repository
Browse code

Merge pull request #1875 from jmarshallnz/check_dirs_on_scan

check directory existence in the video scanner before scanning.
  • Loading branch information...
commit 4d5bd22a805ec4565f7340561d2ea3a3c06497e1 2 parents 276e44f + 5ca0942
jmarshallnz authored December 03, 2012

Showing 1 changed file with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. 12  xbmc/video/VideoInfoScanner.cpp
12  xbmc/video/VideoInfoScanner.cpp
@@ -115,7 +115,17 @@ namespace VIDEO
115 115
          * occurs.
116 116
          */
117 117
         CStdString directory = *m_pathsToScan.begin();
118  
-        if (!DoScan(directory))
  118
+        if (!CDirectory::Exists(directory))
  119
+        {
  120
+          /*
  121
+           * Note that this will skip clean (if m_bClean is enabled) if the directory really
  122
+           * doesn't exist rather than a NAS being switched off.  A manual clean from settings
  123
+           * will still pick up and remove it though.
  124
+           */
  125
+          CLog::Log(LOGWARNING, "%s directory '%s' does not exist - skipping scan%s.", __FUNCTION__, directory.c_str(), m_bClean ? " and clean" : "");
  126
+          m_pathsToScan.erase(m_pathsToScan.begin());
  127
+        }
  128
+        else if (!DoScan(directory))
119 129
           bCancelled = true;
120 130
       }
121 131
 

0 notes on commit 4d5bd22

Please sign in to comment.
Something went wrong with that request. Please try again.