Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 MartijnKaijser authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 xbmc/interfaces/json-rpc/AddonsOperations.cpp
9 xbmc/interfaces/json-rpc/AddonsOperations.cpp
View
@@ -26,10 +26,12 @@
#include "addons/PluginSource.h"
#include "ApplicationMessenger.h"
#include "TextureCache.h"
+#include "filesystem/File.h"
using namespace std;
using namespace JSONRPC;
using namespace ADDON;
+using namespace XFILE;
JSONRPC_STATUS CAddonsOperations::GetAddons(const CStdString &method, ITransportLayer *transport, IClient *client, const CVariant &parameterObject, CVariant &result)
{
@@ -220,12 +222,11 @@ void CAddonsOperations::FillDetails(AddonPtr addon, const CVariant& fields, CVar
else if (field == "fanart" || field == "thumbnail")
{
CStdString url = addonInfo[field].asString();
+ // We need to check the existence of fanart and thumbnails as the addon simply
+ // holds where the art will be, not whether it exists.
bool needsRecaching;
CStdString image = CTextureCache::Get().CheckCachedImage(url, false, needsRecaching);
- if (image.empty())
- image = CTextureCache::Get().CacheImage(url);
-
- if (!image.empty())
+ if (!image.empty() || CFile::Exists(url))
object[field] = CTextureCache::Get().GetWrappedImageURL(url);
else
object[field] = "";
Please sign in to comment.
Something went wrong with that request. Please try again.