Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <AddonRepos.h>
Public Member Functions | |
CAddonRepos () | |
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. | |
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. | |
bool | DoAddonUpdateCheck (const std::shared_ptr< IAddon > &addon, std::shared_ptr< IAddon > &update) const |
Check if an update is available for a single addon. | |
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. | |
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) | |
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) | |
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. | |
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. | |
void | BuildCompatibleVersionsList (std::vector< std::shared_ptr< IAddon > > &compatibleVersions) const |
Build compatible versions list based on the contents of m_allAddons. | |
bool | IsValid () const |
Return whether add-ons repo/version information was properly loaded after construction. | |
Static Public Member Functions | |
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. | |
static bool | IsOfficialRepo (const std::string &repoId) |
Checks if the passed in repository is defined as official repo which includes ORIGIN_SYSTEM. | |
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.
CAddonRepos::CAddonRepos | ( | ) |
|
explicit |
|
explicit |
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.
installed | vector of all addons installed on the system that are checked for an update | |
[out] | addonsWithUpdate | target map |
void CAddonRepos::BuildCompatibleVersionsList | ( | std::vector< std::shared_ptr< IAddon > > & | compatibleVersions | ) | const |
Build compatible versions list based on the contents of m_allAddons.
[out] | compatibleVersions | target vector to be filled |
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.
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 |
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.
addon | that is checked for an update | |
[out] | update | pointer to the found update |
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.
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 |
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.
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 |
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.
addonId | addon id we're looking the latest version for | |
[out] | addon | pointer to the found addon |
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)
[out] | addonList | retrieved addon list in a vector |
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)
[out] | addonList | retrieved addon list in a vector |
|
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.
addon | pointer to addon to be checked |
checkAddonPath | also check origin path |
|
static |
Checks if the passed in repository is defined as official repo which includes ORIGIN_SYSTEM.
repoId | repository id to check |
|
inline |
Return whether add-ons repo/version information was properly loaded after construction.