Merge pull request #1944 from arnova/streamed_filesystem_speed_fix
[vuplus_xbmc] / xbmc / video / VideoThumbLoader.cpp
index 997dacd..c21b593 100644 (file)
@@ -380,6 +380,18 @@ bool CVideoThumbLoader::FillThumb(CFileItem &item)
 
 std::string CVideoThumbLoader::GetLocalArt(const CFileItem &item, const std::string &type, bool checkFolder)
 {
+  /* Cache directory for (sub) folders on streamed filesystems. We need to do this
+     else entering (new) directories from the app thread becomes much slower. This
+     is caused by the fact that Curl Stat/Exist() is really slow and that the 
+     thumbloader thread accesses the streamed filesystem at the same time as the
+     App thread and the latter has to wait for it.
+   */
+  if (item.m_bIsFolder && item.IsInternetStream(true))
+  {
+    CFileItemList items; // Dummy list
+    CDirectory::GetDirectory(item.GetPath(), items, "", DIR_FLAG_NO_FILE_DIRS | DIR_FLAG_READ_CACHE | DIR_FLAG_NO_FILE_INFO);
+  }
+
   std::string art;
   if (!type.empty())
   {