Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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 jmarshallnz authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 xbmc/video/VideoInfoScanner.cpp
View
12 xbmc/video/VideoInfoScanner.cpp
@@ -115,7 +115,17 @@ namespace VIDEO
* occurs.
*/
CStdString directory = *m_pathsToScan.begin();
- if (!DoScan(directory))
+ if (!CDirectory::Exists(directory))
+ {
+ /*
+ * Note that this will skip clean (if m_bClean is enabled) if the directory really
+ * doesn't exist rather than a NAS being switched off. A manual clean from settings
+ * will still pick up and remove it though.
+ */
+ CLog::Log(LOGWARNING, "%s directory '%s' does not exist - skipping scan%s.", __FUNCTION__, directory.c_str(), m_bClean ? " and clean" : "");
+ m_pathsToScan.erase(m_pathsToScan.begin());
+ }
+ else if (!DoScan(directory))
bCancelled = true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.