Skip to content
This repository
Browse code

Merge pull request #1876 from jmarshallnz/addon_art_checks

[json-rpc] check add-on art existence using CFile::Exists()
  • Loading branch information...
commit 833d84d8ec5838bcc995797766aab7d2a7e83d51 2 parents 192701b + 437ec27
Martijn Kaijser authored December 02, 2012
9  xbmc/interfaces/json-rpc/AddonsOperations.cpp
@@ -26,10 +26,12 @@
26 26
 #include "addons/PluginSource.h"
27 27
 #include "ApplicationMessenger.h"
28 28
 #include "TextureCache.h"
  29
+#include "filesystem/File.h"
29 30
 
30 31
 using namespace std;
31 32
 using namespace JSONRPC;
32 33
 using namespace ADDON;
  34
+using namespace XFILE;
33 35
 
34 36
 JSONRPC_STATUS CAddonsOperations::GetAddons(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
35 37
 {
@@ -220,12 +222,11 @@ void CAddonsOperations::FillDetails(AddonPtr addon, const CVariant& fields, CVar
220 222
     else if (field == "fanart" || field == "thumbnail")
221 223
     {
222 224
       CStdString url = addonInfo[field].asString();
  225
+      // We need to check the existence of fanart and thumbnails as the addon simply
  226
+      // holds where the art will be, not whether it exists.
223 227
       bool needsRecaching;
224 228
       CStdString image = CTextureCache::Get().CheckCachedImage(url, false, needsRecaching);
225  
-      if (image.empty())
226  
-        image = CTextureCache::Get().CacheImage(url);
227  
-
228  
-      if (!image.empty())
  229
+      if (!image.empty() || CFile::Exists(url))
229 230
         object[field] = CTextureCache::Get().GetWrappedImageURL(url);
230 231
       else
231 232
         object[field] = "";

0 notes on commit 833d84d

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