aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank H <58829855+howie-f@users.noreply.github.com>2022-10-02 05:25:39 +0200
committerGitHub <noreply@github.com>2022-10-02 05:25:39 +0200
commit286694e9df8741313a688b46940661a30f36f35c (patch)
tree86fd09f3a0e0987292757e1dd589270ec41d2987
parenta8429610f28192fae74311eca615b6ebaa60ff7d (diff)
parent78f4f949f3d08cebf6b9b448c92e78b8b1f93404 (diff)
downloadxbmc-286694e9df8741313a688b46940661a30f36f35c.tar.xz
Merge pull request #21584 from howie-f/v19-fix-addons-update
[addons] fix update detection based on „official/any repo“ setting
-rw-r--r--xbmc/addons/AddonRepos.cpp16
-rw-r--r--xbmc/addons/AddonRepos.h6
2 files changed, 11 insertions, 11 deletions
diff --git a/xbmc/addons/AddonRepos.cpp b/xbmc/addons/AddonRepos.cpp
index 462660908f..5cea7b1d2b 100644
--- a/xbmc/addons/AddonRepos.cpp
+++ b/xbmc/addons/AddonRepos.cpp
@@ -238,9 +238,13 @@ bool CAddonRepos::DoAddonUpdateCheck(const std::shared_ptr<IAddon>& addon,
{
if (ORIGIN_SYSTEM != addon->Origin() && !hasOfficialUpdate) // not a system addon
{
- // If we didn't find an official update
- if (IsFromOfficialRepo(addon, CheckAddonPath::YES)) // is an official addon
+
+ // we didn't find an official update.
+ // either version is current or that add-on isn't contained in official repos
+ if (IsFromOfficialRepo(addon, CheckAddonPath::NO))
{
+
+ // check further if it IS contained in official repos
if (updateMode == AddonRepoUpdateMode::ANY_REPOSITORY)
{
if (!FindAddonAndCheckForUpdate(addon, m_latestPrivateVersions, update))
@@ -287,15 +291,11 @@ bool CAddonRepos::FindAddonAndCheckForUpdate(
{
// return addon update
update = remote->second;
+ return true; // update found
}
- else
- {
- // addon found, but it's up to date
- update = nullptr;
- }
- return true;
}
+ // either addon wasn't found or it's up to date
return false;
}
diff --git a/xbmc/addons/AddonRepos.h b/xbmc/addons/AddonRepos.h
index 3e241d9a9f..d966b5c863 100644
--- a/xbmc/addons/AddonRepos.h
+++ b/xbmc/addons/AddonRepos.h
@@ -207,9 +207,9 @@ private:
* \param map the repository map we want to check against
* \param[out] pointer to the found update. if the addon is
* up-to-date on our system, this param will return 'nullptr'
- * \return true if the addon was found in the desired map,
- * either up-to-date or newer version.
- * false if the addon does NOT exist in the map
+ * \return true if the addon was found in the desired map and
+ * its version is newer than our local version.
+ * false if the addon does NOT exist in the map or it is up to date.
*/
bool FindAddonAndCheckForUpdate(const std::shared_ptr<IAddon>& addonToCheck,
const std::map<std::string, std::shared_ptr<IAddon>>& map,