Class - CAddonRepos Reads information about installed official/third party repos and their contained add-ons from the database.
More...
#include <AddonRepos.h>
|
| CAddonRepos (const std::string &addonId) |
|
| CAddonRepos (const std::shared_ptr< IAddon > &repoAddon) |
|
void | BuildUpdateOrOutdatedList (const std::vector< std::shared_ptr< IAddon >> &installed, std::vector< std::shared_ptr< IAddon >> &result, AddonCheckType addonCheckType) const |
| Build the list of addons to be updated depending on defined rules or the list of outdated addons. More...
|
|
void | BuildAddonsWithUpdateList (const std::vector< std::shared_ptr< IAddon >> &installed, std::map< std::string, AddonWithUpdate > &addonsWithUpdate) const |
| Build the list of outdated addons and their available updates. More...
|
|
bool | DoAddonUpdateCheck (const std::shared_ptr< IAddon > &addon, std::shared_ptr< IAddon > &update) const |
| Check if an update is available for a single addon. More...
|
|
bool | GetLatestAddonVersionFromAllRepos (const std::string &addonId, std::shared_ptr< IAddon > &addon) const |
| Retrieves the latest version of an addon from all installed repositories follows addon origin restriction rules. More...
|
|
void | GetLatestAddonVersions (std::vector< std::shared_ptr< IAddon >> &addonList) const |
| Retrieves the latest official versions of addons to vector. Private versions are added obeying updateMode. (either OFFICIAL_ONLY or ANY_REPOSITORY) More...
|
|
void | GetLatestAddonVersionsFromAllRepos (std::vector< std::shared_ptr< IAddon >> &addonList) const |
| Retrieves the latest official versions of addons to vector. Private versions (latest per repository) are added obeying updateMode. (either OFFICIAL_ONLY or ANY_REPOSITORY) More...
|
|
bool | FindDependency (const std::string &dependsId, const std::string &parentRepoId, std::shared_ptr< IAddon > &dependencyToInstall, std::shared_ptr< CRepository > &repoForDep) const |
| Find a dependency to install during an addon install or update If the dependency cannot be found in official versions we look in the installing/updating addon's (the parent's) origin repository. More...
|
|
bool | FindDependencyByParentRepo (const std::string &dependsId, const std::string &parentRepoId, std::shared_ptr< IAddon > &dependencyToInstall) const |
| Find a dependency addon in the repository of its parent. More...
|
|
void | BuildCompatibleVersionsList (std::vector< std::shared_ptr< IAddon >> &compatibleVersions) const |
| Build compatible versions list based on the contents of m_allAddons. More...
|
|
bool | IsValid () const |
| Return whether add-ons repo/version information was properly loaded after construction. More...
|
|
|
static bool | IsFromOfficialRepo (const std::shared_ptr< IAddon > &addon, CheckAddonPath checkAddonPath) |
| Checks if the origin-repository of a given addon is defined as official repo and can also verify if the origin-path (e.g. https://mirrors.kodi.tv ...) is matching. More...
|
|
static bool | IsOfficialRepo (const std::string &repoId) |
| Checks if the passed in repository is defined as official repo which includes ORIGIN_SYSTEM. More...
|
|
Class - CAddonRepos Reads information about installed official/third party repos and their contained add-ons from the database.
Used to check for updates for installed add-ons and dependencies while obeying permission rules. Note that this class is not responsible for refreshing the repo data stored in the database.
◆ BuildAddonsWithUpdateList()
void CAddonRepos::BuildAddonsWithUpdateList |
( |
const std::vector< std::shared_ptr< IAddon >> & |
installed, |
|
|
std::map< std::string, AddonWithUpdate > & |
addonsWithUpdate |
|
) |
| const |
Build the list of outdated addons and their available updates.
- Parameters
-
| installed | vector of all addons installed on the system that are checked for an update |
[out] | addonsWithUpdate | target map |
◆ BuildCompatibleVersionsList()
void CAddonRepos::BuildCompatibleVersionsList |
( |
std::vector< std::shared_ptr< IAddon >> & |
compatibleVersions | ) |
const |
Build compatible versions list based on the contents of m_allAddons.
- Note
- content of m_allAddons depends on the preceding call to LoadAddonsFromDatabase()
- Parameters
-
[out] | compatibleVersions | target vector to be filled |
◆ BuildUpdateOrOutdatedList()
void CAddonRepos::BuildUpdateOrOutdatedList |
( |
const std::vector< std::shared_ptr< IAddon >> & |
installed, |
|
|
std::vector< std::shared_ptr< IAddon >> & |
result, |
|
|
AddonCheckType |
addonCheckType |
|
) |
| const |
Build the list of addons to be updated depending on defined rules or the list of outdated addons.
- Parameters
-
| installed | vector of all addons installed on the system that are checked for an update |
[in] | addonCheckType | build list of OUTDATED or UPDATES |
[out] | result | list of addon versions that are going to be installed or are outdated |
◆ DoAddonUpdateCheck()
bool CAddonRepos::DoAddonUpdateCheck |
( |
const std::shared_ptr< IAddon > & |
addon, |
|
|
std::shared_ptr< IAddon > & |
update |
|
) |
| const |
Check if an update is available for a single addon.
- Parameters
-
| addon | that is checked for an update |
[out] | update | pointer to the found update |
- Returns
- true if an installable update was found, false otherwise
◆ FindDependency()
bool CAddonRepos::FindDependency |
( |
const std::string & |
dependsId, |
|
|
const std::string & |
parentRepoId, |
|
|
std::shared_ptr< IAddon > & |
dependencyToInstall, |
|
|
std::shared_ptr< CRepository > & |
repoForDep |
|
) |
| const |
Find a dependency to install during an addon install or update If the dependency cannot be found in official versions we look in the installing/updating addon's (the parent's) origin repository.
- Parameters
-
| dependsId | addon id of the dependency we're looking for |
| parentRepoId | origin repository of the dependee |
[out] | dependencyToInstall | pointer to the found dependency, only use if function returns true |
[out] | repoForDep | the repository that dependency will install from finally |
- Returns
- true if the dependency was found, false otherwise
◆ FindDependencyByParentRepo()
bool CAddonRepos::FindDependencyByParentRepo |
( |
const std::string & |
dependsId, |
|
|
const std::string & |
parentRepoId, |
|
|
std::shared_ptr< IAddon > & |
dependencyToInstall |
|
) |
| const |
Find a dependency addon in the repository of its parent.
- Parameters
-
| dependsId | addon id of the dependency we're looking for |
| parentRepoId | origin repository of the dependee |
[out] | dependencyToInstall | pointer to the found dependency, only use if function returns true |
- Returns
- true if the dependency was found, false otherwise
◆ GetLatestAddonVersionFromAllRepos()
bool CAddonRepos::GetLatestAddonVersionFromAllRepos |
( |
const std::string & |
addonId, |
|
|
std::shared_ptr< IAddon > & |
addon |
|
) |
| const |
Retrieves the latest version of an addon from all installed repositories follows addon origin restriction rules.
- Parameters
-
| addonId | addon id we're looking the latest version for |
[out] | addon | pointer to the found addon |
- Returns
- true if a version was found, false otherwise
◆ GetLatestAddonVersions()
void CAddonRepos::GetLatestAddonVersions |
( |
std::vector< std::shared_ptr< IAddon >> & |
addonList | ) |
const |
Retrieves the latest official versions of addons to vector. Private versions are added obeying updateMode. (either OFFICIAL_ONLY or ANY_REPOSITORY)
- Parameters
-
[out] | addonList | retrieved addon list in a vector |
◆ GetLatestAddonVersionsFromAllRepos()
void CAddonRepos::GetLatestAddonVersionsFromAllRepos |
( |
std::vector< std::shared_ptr< IAddon >> & |
addonList | ) |
const |
Retrieves the latest official versions of addons to vector. Private versions (latest per repository) are added obeying updateMode. (either OFFICIAL_ONLY or ANY_REPOSITORY)
- Parameters
-
[out] | addonList | retrieved addon list in a vector |
◆ IsFromOfficialRepo()
bool CAddonRepos::IsFromOfficialRepo |
( |
const std::shared_ptr< IAddon > & |
addon, |
|
|
CheckAddonPath |
checkAddonPath |
|
) |
| |
|
static |
Checks if the origin-repository of a given addon is defined as official repo and can also verify if the origin-path (e.g. https://mirrors.kodi.tv ...) is matching.
- Note
- if this function is called on locally installed add-ons, for instance when populating 'My add-ons', the local installation path is returned as origin. thus parameter CheckAddonPath::CHOICE_NO needs to be passed in such cases
- Parameters
-
addon | pointer to addon to be checked |
checkAddonPath | also check origin path |
- Returns
- true if the repository id of a given addon is defined as official and the addons origin matches the defined official origin of the repo id
◆ IsOfficialRepo()
bool CAddonRepos::IsOfficialRepo |
( |
const std::string & |
repoId | ) |
|
|
static |
Checks if the passed in repository is defined as official repo which includes ORIGIN_SYSTEM.
- Parameters
-
repoId | repository id to check |
- Returns
- true if the repository id is defined as official, false otherwise
◆ IsValid()
bool ADDON::CAddonRepos::IsValid |
( |
| ) |
const |
|
inline |
Return whether add-ons repo/version information was properly loaded after construction.
- Returns
- true on success, false otherwise
The documentation for this class was generated from the following files: