Skip to content
This repository
Browse code

Merge pull request #1879 from Montellese/addons_extpoint_minversion

addons: use the extension-point's version if no minversion (i.e. no <backwards-compatibility> tag) is specified when checking imported extension-points
  • Loading branch information...
commit 08666e76950719918a2636071eb6aa7c840130e9 2 parents d78d85e + e2e8068
Martijn Kaijser authored

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  xbmc/addons/Addon.cpp
8  xbmc/addons/Addon.cpp
@@ -32,6 +32,7 @@
32 32
 #include "freebsd/FreeBSDGNUReplacements.h"
33 33
 #endif
34 34
 #include "utils/log.h"
  35
+#include "utils/StringUtils.h"
35 36
 #include "utils/URIUtils.h"
36 37
 #include "URL.h"
37 38
 #include <vector>
@@ -313,6 +314,13 @@ AddonPtr CAddon::Clone(const AddonPtr &self) const
313 314
 
314 315
 bool CAddon::MeetsVersion(const AddonVersion &version) const
315 316
 {
  317
+  // if the addon is one of xbmc's extension point definitions (addonid starts with "xbmc.")
  318
+  // and the minversion is "0.0.0" i.e. no <backwards-compatibility> tag has been specified
  319
+  // we need to assume that the current version is not backwards-compatible and therefore check against the actual version
  320
+  if (StringUtils::StartsWith(m_props.id, "xbmc.") &&
  321
+     (strlen(m_props.minversion.c_str()) == 0 || StringUtils::EqualsNoCase(m_props.minversion.c_str(), "0.0.0")))
  322
+    return m_props.version == version;
  323
+
316 324
   return m_props.minversion <= version && version <= m_props.version;
317 325
 }
318 326
 

0 notes on commit 08666e7

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