From db0bffb4382752332dccddfed1d8cd2f71f45e4c Mon Sep 17 00:00:00 2001 From: ulion Date: Sat, 13 Apr 2013 06:27:11 +0800 Subject: Check dir cache after SubstitutePath. --- xbmc/filesystem/Directory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/filesystem/Directory.cpp b/xbmc/filesystem/Directory.cpp index 7a526e1616..e174ca898f 100644 --- a/xbmc/filesystem/Directory.cpp +++ b/xbmc/filesystem/Directory.cpp @@ -255,6 +255,7 @@ bool CDirectory::Exists(const CStdString& strPath, bool bUseCache /* = true */) { try { + CStdString realPath = URIUtils::SubstitutePath(strPath); if (bUseCache) { bool bPathInCache; @@ -263,7 +264,6 @@ bool CDirectory::Exists(const CStdString& strPath, bool bUseCache /* = true */) if (bPathInCache) return false; } - CStdString realPath = URIUtils::SubstitutePath(strPath); auto_ptr pDirectory(CDirectoryFactory::Create(realPath)); if (pDirectory.get()) return pDirectory->Exists(realPath.c_str()); -- cgit v1.2.3 From 87c4faf2822470f597d46c15d30b97b93cf1d752 Mon Sep 17 00:00:00 2001 From: ulion Date: Sat, 13 Apr 2013 06:27:43 +0800 Subject: Make sure dir ends with slash when check cache. --- xbmc/filesystem/Directory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xbmc/filesystem/Directory.cpp b/xbmc/filesystem/Directory.cpp index e174ca898f..dac2e7ac32 100644 --- a/xbmc/filesystem/Directory.cpp +++ b/xbmc/filesystem/Directory.cpp @@ -259,7 +259,8 @@ bool CDirectory::Exists(const CStdString& strPath, bool bUseCache /* = true */) if (bUseCache) { bool bPathInCache; - if (g_directoryCache.FileExists(strPath, bPathInCache)) + URIUtils::AddSlashAtEnd(realPath); + if (g_directoryCache.FileExists(realPath, bPathInCache)) return true; if (bPathInCache) return false; -- cgit v1.2.3