ensure we re-check the cache while running a bg cache job, as it may have been cached...
authorJonathan Marshall <jmarshall@never.you.mind>
Wed, 2 May 2012 01:51:55 +0000 (13:51 +1200)
committerJonathan Marshall <jmarshall@never.you.mind>
Wed, 2 May 2012 03:32:45 +0000 (15:32 +1200)
xbmc/TextureCacheJob.cpp

index e1ed5c6..d24fcc2 100644 (file)
@@ -63,6 +63,11 @@ bool CTextureCacheJob::DoWork()
   if (ShouldCancel(1, 0)) // HACK: second check is because we cancel the job in the first callback, but we don't detect it
     return false;         //       until the second
 
+  // check whether we need cache the job anyway
+  bool needsRecaching = false;
+  CStdString path(CTextureCache::Get().CheckCachedImage(m_url, false, needsRecaching));
+  if (!path.IsEmpty() && !needsRecaching)
+    return false;
   return CacheTexture();
 }