Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <AddonManager.h>
Public Member Functions | |
bool | ReInit () |
bool | Init () |
void | DeInit () |
CAddonMgr () | |
CAddonMgr (const CAddonMgr &)=delete | |
virtual | ~CAddonMgr () |
CEventStream< AddonEvent > & | Events () |
CEventStream< AddonEvent > & | UnloadEvents () |
IAddonMgrCallback * | GetCallbackForType (AddonType type) |
bool | RegisterAddonMgrCallback (AddonType type, IAddonMgrCallback *cb) |
void | UnregisterAddonMgrCallback (AddonType type) |
bool | GetAddon (const std::string &id, AddonPtr &addon, AddonType type, OnlyEnabled onlyEnabled) const |
Retrieve a specific addon (of a specific type) | |
bool | GetAddon (const std::string &id, AddonPtr &addon, OnlyEnabled onlyEnabled) const |
Retrieve a specific addon (of no specific type) | |
bool | HasType (const std::string &id, AddonType type) |
bool | HasAddons (AddonType type) |
bool | HasInstalledAddons (AddonType type) |
bool | GetAddonsForUpdate (VECADDONS &addons) const |
bool | GetAddons (VECADDONS &addons) const |
bool | GetAddons (VECADDONS &addons, AddonType type) |
bool | GetInstalledAddons (VECADDONS &addons) |
bool | GetInstalledAddons (VECADDONS &addons, AddonType type) |
bool | GetDisabledAddons (VECADDONS &addons) |
bool | GetDisabledAddons (VECADDONS &addons, AddonType type) |
bool | GetInstallableAddons (VECADDONS &addons) |
bool | GetInstallableAddons (VECADDONS &addons, AddonType type) |
bool | FindInstallableById (const std::string &addonId, AddonPtr &addon) |
Get the installable addon depending on install rules or fall back to highest version. | |
void | AddToUpdateableAddons (AddonPtr &pAddon) |
void | RemoveFromUpdateableAddons (AddonPtr &pAddon) |
bool | ReloadSettings (const std::string &addonId, AddonInstanceId instanceId) |
std::vector< std::shared_ptr< IAddon > > | GetAvailableUpdates () const |
std::vector< std::shared_ptr< IAddon > > | GetOutdatedAddons () const |
bool | HasAvailableUpdates () |
bool | IsOrphaned (const std::shared_ptr< IAddon > &addon, const std::vector< std::shared_ptr< IAddon > > &allAddons) const |
Checks if the passed in addon is an orphaned dependency. | |
bool | FindAddons () |
Checks for new / updated add-ons. | |
bool | FindAddon (const std::string &addonId, const std::string &origin, const CAddonVersion &addonVersion) |
Checks whether given addon with given origin/version is installed. | |
bool | GetIncompatibleEnabledAddonInfos (std::vector< AddonInfoPtr > &incompatible) const |
Fills the the provided vector with the list of incompatible enabled addons and returns if there's any. | |
std::vector< AddonInfoPtr > | MigrateAddons () |
std::vector< AddonInfoPtr > | DisableIncompatibleAddons (const std::vector< AddonInfoPtr > &incompatible) |
Try to disable addons in the given list. | |
void | CheckAndInstallAddonUpdates (bool wait) const |
bool | UnloadAddon (const std::string &addonId) |
bool | LoadAddon (const std::string &addonId, const std::string &origin, const CAddonVersion &addonVersion) |
void | OnPostUnInstall (const std::string &id) |
bool | DisableAddon (const std::string &ID, AddonDisabledReason disabledReason) |
Disable an addon. Returns true on success, false on failure. | |
bool | UpdateDisabledReason (const std::string &id, AddonDisabledReason newDisabledReason) |
Updates reason for a disabled addon. Returns true on success, false on failure. | |
bool | EnableAddon (const std::string &ID) |
Enable an addon. Returns true on success, false on failure. | |
bool | IsAddonDisabled (const std::string &ID) const |
bool | IsAddonDisabledExcept (const std::string &ID, AddonDisabledReason disabledReason) const |
Check whether an addon has been disabled via DisableAddon except for a particular reason In case the disabled cache does not know about the current state the database routine will be used. | |
bool | CanAddonBeDisabled (const std::string &ID) |
bool | CanAddonBeEnabled (const std::string &id) |
bool | IsAddonInstalled (const std::string &ID) |
bool | IsAddonInstalled (const std::string &ID, const std::string &origin) const |
bool | IsAddonInstalled (const std::string &ID, const std::string &origin, const CAddonVersion &version) |
bool | CanAddonBeInstalled (const AddonPtr &addon) |
bool | CanUninstall (const AddonPtr &addon) |
bool | IsBundledAddon (const std::string &id) |
Checks whether an addon is a bundled addon. | |
bool | IsSystemAddon (const std::string &id) |
Checks whether an addon is a system addon. | |
bool | IsRequiredSystemAddon (const std::string &id) |
Checks whether an addon is a required system addon. | |
bool | IsOptionalSystemAddon (const std::string &id) |
Checks whether an addon is an optional system addon. | |
bool | AddUpdateRuleToList (const std::string &id, AddonUpdateRule updateRule) |
Addon update rules. | |
bool | RemoveAllUpdateRulesFromList (const std::string &id) |
bool | RemoveUpdateRuleFromList (const std::string &id, AddonUpdateRule updateRule) |
bool | IsAutoUpdateable (const std::string &id) const |
void | PublishEventAutoUpdateStateChanged (const std::string &id) |
void | UpdateLastUsed (const std::string &id) |
void | PublishInstanceAdded (const std::string &addonId, AddonInstanceId instanceId) |
Launches event AddonEvent::InstanceAdded. | |
void | PublishInstanceRemoved (const std::string &addonId, AddonInstanceId instanceId) |
Launches event AddonEvent::InstanceRemoved. | |
bool | LoadAddonDescription (const std::string &path, AddonPtr &addon) |
Load the addon in the given path This loads the addon using c-pluff which parses the addon descriptor file. | |
bool | ServicesHasStarted () const |
bool | IsCompatible (const std::shared_ptr< const IAddon > &addon) const |
Check if given addon is compatible with Kodi. | |
bool | IsCompatible (const AddonInfoPtr &addonInfo) const |
Check given addon information is compatible with Kodi. | |
std::vector< DependencyInfo > | GetDepsRecursive (const std::string &id, OnlyEnabledRootAddon onlyEnabledRootAddon) |
Recursively get dependencies for an add-on. | |
bool | GetAddonInfos (std::vector< AddonInfoPtr > &addonInfos, bool onlyEnabled, AddonType type) const |
Get a list of add-on's with info's for the on system available ones. | |
std::vector< AddonInfoPtr > | GetAddonInfos (bool onlyEnabled, const std::vector< AddonType > &types) const |
Get a list of add-on's with info's for the on system available ones. | |
bool | GetDisabledAddonInfos (std::vector< AddonInfoPtr > &addonInfos, AddonType type) const |
Get a list of disabled add-on's with info's. | |
bool | GetDisabledAddonInfos (std::vector< AddonInfoPtr > &addonInfos, AddonType type, AddonDisabledReason disabledReason) const |
Get a list of disabled add-on's with info's for the on system available ones with a specific disabled reason. | |
const AddonInfoPtr | GetAddonInfo (const std::string &id, AddonType type) const |
const std::string & | GetTempAddonBasePath () |
Get the path where temporary add-on files are stored. | |
AddonOriginType | GetAddonOriginType (const AddonPtr &addon) const |
bool | IsAddonDisabledWithReason (const std::string &ID, AddonDisabledReason disabledReason) const |
Check whether an addon has been disabled with a special reason. | |
bool | SetAddonOrigin (const std::string &addonId, const std::string &repoAddonId, bool isUpdate) |
Addon update and install management. | |
bool | AddonsFromRepoXML (const RepositoryDirInfo &repo, const std::string &xml, std::vector< AddonInfoPtr > &addons) |
Parse a repository XML file for addons and load their descriptors. | |
std::map< std::string, AddonWithUpdate > | GetAddonsWithAvailableUpdate () const |
Retrieves list of outdated addons as well as their related available updates and stores them into map. | |
std::vector< std::shared_ptr< IAddon > > | GetCompatibleVersions (const std::string &addonId) const |
Retrieves list of compatible addon versions of all origins. | |
const std::string & | GetLastAvailableUpdatesCountAsString () const |
Return number of available updates formatted as string this can be used as a lightweight method of retrieving the number of updates rather than using the expensive GetAvailableUpdates call. | |
std::vector< std::shared_ptr< IAddon > > | GetOrphanedDependencies () const |
returns a vector with all found orphaned dependencies. | |
Class - CAddonMgr Holds references to all addons, enabled or otherwise. Services the generic callbacks available to all addon variants.
ADDON::CAddonMgr::CAddonMgr | ( | ) |
|
delete |
|
virtual |
bool ADDON::CAddonMgr::AddonsFromRepoXML | ( | const RepositoryDirInfo & | repo, |
const std::string & | xml, | ||
std::vector< AddonInfoPtr > & | addons ) |
Parse a repository XML file for addons and load their descriptors.
A repository XML is essentially a concatenated list of addon descriptors.
[in] | repo | The repository info. |
[in] | xml | The XML document from repository. |
[out] | addons | returned list of addons. |
Currently listed call sources:
bool ADDON::CAddonMgr::AddUpdateRuleToList | ( | const std::string & | id, |
AddonUpdateRule | updateRule ) |
Addon update rules.
member functions for handling and querying add-on update rules
bool ADDON::CAddonMgr::CanAddonBeDisabled | ( | const std::string & | ID | ) |
bool ADDON::CAddonMgr::CanAddonBeEnabled | ( | const std::string & | id | ) |
Install available addon updates, if any.
wait | If kodi should wait for all updates to download and install before returning |
void ADDON::CAddonMgr::DeInit | ( | ) |
bool ADDON::CAddonMgr::DisableAddon | ( | const std::string & | ID, |
AddonDisabledReason | disabledReason ) |
Disable an addon. Returns true on success, false on failure.
std::vector< AddonInfoPtr > ADDON::CAddonMgr::DisableIncompatibleAddons | ( | const std::vector< AddonInfoPtr > & | incompatible | ) |
Try to disable addons in the given list.
[in] | incompatible | List of incompatible addon infos |
bool ADDON::CAddonMgr::EnableAddon | ( | const std::string & | ID | ) |
Enable an addon. Returns true on success, false on failure.
|
inline |
bool ADDON::CAddonMgr::FindAddon | ( | const std::string & | addonId, |
const std::string & | origin, | ||
const CAddonVersion & | addonVersion ) |
Checks whether given addon with given origin/version is installed.
addonId | addon to check |
origin | origin to check |
addonVersion | version to check |
bool ADDON::CAddonMgr::FindAddons | ( | ) |
Checks for new / updated add-ons.
Get the installable addon depending on install rules or fall back to highest version.
addonId | addon to check for update or installation |
addon[out] | the retrieved addon pointer - only use if the function returns true. |
bool ADDON::CAddonMgr::GetAddon | ( | const std::string & | id, |
AddonPtr & | addon, | ||
AddonType | type, | ||
OnlyEnabled | onlyEnabled ) const |
Retrieve a specific addon (of a specific type)
id | the id of the addon to retrieve. |
addon[out] | the retrieved addon pointer - only use if the function returns true. |
type | type of addon to retrieve - defaults to any type. |
onlyEnabled | whether we only want enabled addons - set to false to allow both enabled and disabled addons - defaults to true. |
bool ADDON::CAddonMgr::GetAddon | ( | const std::string & | id, |
AddonPtr & | addon, | ||
OnlyEnabled | onlyEnabled ) const |
Retrieve a specific addon (of no specific type)
id | the id of the addon to retrieve. |
addon[out] | the retrieved addon pointer - only use if the function returns true. |
onlyEnabled | whether we only want enabled addons - set to false to allow both enabled and disabled addons - defaults to true. |
const AddonInfoPtr ADDON::CAddonMgr::GetAddonInfo | ( | const std::string & | id, |
AddonType | type ) const |
std::vector< AddonInfoPtr > ADDON::CAddonMgr::GetAddonInfos | ( | bool | onlyEnabled, |
const std::vector< AddonType > & | types ) const |
Get a list of add-on's with info's for the on system available ones.
[in] | onlyEnabled | If true are only enabled ones given back, if false all on system available. Default is true. |
[in] | types | List about requested types. |
bool ADDON::CAddonMgr::GetAddonInfos | ( | std::vector< AddonInfoPtr > & | addonInfos, |
bool | onlyEnabled, | ||
AddonType | type ) const |
Get a list of add-on's with info's for the on system available ones.
[out] | addonInfos | list where finded addon information becomes stored |
[in] | onlyEnabled | If true are only enabled ones given back, if false all on system available. Default is true. |
[in] | type | The requested type, with "ADDON_UNKNOWN" are all add-on types given back who match the case with value before. If a type id becomes added are only add-ons returned who match them. Default is for all types. |
AddonOriginType ADDON::CAddonMgr::GetAddonOriginType | ( | const AddonPtr & | addon | ) | const |
Returns all installed, enabled add-ons.
Returns enabled add-ons with given type.
Returns all installed, enabled and incompatible (and disabled) add-ons.
std::map< std::string, AddonWithUpdate > ADDON::CAddonMgr::GetAddonsWithAvailableUpdate | ( | ) | const |
Retrieves list of outdated addons as well as their related available updates and stores them into map.
std::vector< std::shared_ptr< IAddon > > ADDON::CAddonMgr::GetAvailableUpdates | ( | ) | const |
Get addons with available updates
IAddonMgrCallback * ADDON::CAddonMgr::GetCallbackForType | ( | AddonType | type | ) |
std::vector< std::shared_ptr< IAddon > > ADDON::CAddonMgr::GetCompatibleVersions | ( | const std::string & | addonId | ) | const |
Retrieves list of compatible addon versions of all origins.
[in] | addonId | addon to look up |
std::vector< DependencyInfo > ADDON::CAddonMgr::GetDepsRecursive | ( | const std::string & | id, |
OnlyEnabledRootAddon | onlyEnabledRootAddon ) |
Recursively get dependencies for an add-on.
id | the id of the root addon |
onlyEnabledRootAddon | whether look for enabled root add-ons only |
bool ADDON::CAddonMgr::GetDisabledAddonInfos | ( | std::vector< AddonInfoPtr > & | addonInfos, |
AddonType | type ) const |
Get a list of disabled add-on's with info's.
[out] | addonInfos | list where finded addon information becomes stored |
[in] | type | The requested type, with "ADDON_UNKNOWN" are all add-on types given back who match the case with value before. If a type id becomes added are only add-ons returned who match them. Default is for all types. |
bool ADDON::CAddonMgr::GetDisabledAddonInfos | ( | std::vector< AddonInfoPtr > & | addonInfos, |
AddonType | type, | ||
AddonDisabledReason | disabledReason ) const |
Get a list of disabled add-on's with info's for the on system available ones with a specific disabled reason.
[out] | addonInfos | list where finded addon information becomes stored |
[in] | type | The requested type, with "ADDON_UNKNOWN" are all add-on types given back who match the case with value before. If a type id becomes added are only add-ons returned who match them. Default is for all types. |
[in] | disabledReason | To get all disabled addons use the value "AddonDiasbledReason::NONE". If any other value is supplied only addons with that reason will be returned. |
bool ADDON::CAddonMgr::GetIncompatibleEnabledAddonInfos | ( | std::vector< AddonInfoPtr > & | incompatible | ) | const |
Fills the the provided vector with the list of incompatible enabled addons and returns if there's any.
[out] | incompatible | List of incompatible addons |
Returns all installed, including disabled.
Returns installed add-ons, including disabled, with given type.
const std::string & ADDON::CAddonMgr::GetLastAvailableUpdatesCountAsString | ( | ) | const |
Return number of available updates formatted as string this can be used as a lightweight method of retrieving the number of updates rather than using the expensive GetAvailableUpdates call.
std::vector< std::shared_ptr< IAddon > > ADDON::CAddonMgr::GetOrphanedDependencies | ( | ) | const |
returns a vector with all found orphaned dependencies.
std::vector< std::shared_ptr< IAddon > > ADDON::CAddonMgr::GetOutdatedAddons | ( | ) | const |
Get addons that are outdated
|
inline |
Get the path where temporary add-on files are stored.
bool ADDON::CAddonMgr::HasAvailableUpdates | ( | ) |
Returns true if there is any addon with available updates, otherwise false
bool ADDON::CAddonMgr::Init | ( | ) |
bool ADDON::CAddonMgr::IsAddonDisabled | ( | const std::string & | ID | ) | const |
bool ADDON::CAddonMgr::IsAddonDisabledExcept | ( | const std::string & | ID, |
AddonDisabledReason | disabledReason ) const |
Check whether an addon has been disabled via DisableAddon except for a particular reason In case the disabled cache does not know about the current state the database routine will be used.
[in] | ID | id of the addon |
[in] | disabledReason | the reason that will be an exception to being disabled |
bool ADDON::CAddonMgr::IsAddonDisabledWithReason | ( | const std::string & | ID, |
AddonDisabledReason | disabledReason ) const |
Check whether an addon has been disabled with a special reason.
ID | id of the addon |
disabledReason | reason we want to check for (NONE, USER, INCOMPATIBLE, PERMANENT_FAILURE) |
bool ADDON::CAddonMgr::IsAddonInstalled | ( | const std::string & | ID | ) |
bool ADDON::CAddonMgr::IsAddonInstalled | ( | const std::string & | ID, |
const std::string & | origin ) const |
bool ADDON::CAddonMgr::IsAddonInstalled | ( | const std::string & | ID, |
const std::string & | origin, | ||
const CAddonVersion & | version ) |
bool ADDON::CAddonMgr::IsAutoUpdateable | ( | const std::string & | id | ) | const |
bool ADDON::CAddonMgr::IsBundledAddon | ( | const std::string & | id | ) |
Checks whether an addon is a bundled addon.
[in] | id | id of the addon |
bool ADDON::CAddonMgr::IsCompatible | ( | const AddonInfoPtr & | addonInfo | ) | const |
Check given addon information is compatible with Kodi.
[in] | addonInfo | Addon information to check |
Check if given addon is compatible with Kodi.
[in] | addon | Addon to check |
bool ADDON::CAddonMgr::IsOptionalSystemAddon | ( | const std::string & | id | ) |
Checks whether an addon is an optional system addon.
[in] | id | id of the addon |
bool ADDON::CAddonMgr::IsOrphaned | ( | const std::shared_ptr< IAddon > & | addon, |
const std::vector< std::shared_ptr< IAddon > > & | allAddons ) const |
Checks if the passed in addon is an orphaned dependency.
addon | the add-on/dependency to check |
allAddons | vector of all installed add-ons |
bool ADDON::CAddonMgr::IsRequiredSystemAddon | ( | const std::string & | id | ) |
Checks whether an addon is a required system addon.
[in] | id | id of the addon |
bool ADDON::CAddonMgr::IsSystemAddon | ( | const std::string & | id | ) |
Checks whether an addon is a system addon.
[in] | id | id of the addon |
bool ADDON::CAddonMgr::LoadAddon | ( | const std::string & | addonId, |
const std::string & | origin, | ||
const CAddonVersion & | addonVersion ) |
Returns true if the addon was successfully loaded and enabled; otherwise false.
Load the addon in the given path This loads the addon using c-pluff which parses the addon descriptor file.
path | folder that contains the addon. |
addon | [out] returned addon. |
std::vector< AddonInfoPtr > ADDON::CAddonMgr::MigrateAddons | ( | ) |
Migrate all the addons (updates all addons that have an update pending and disables those that got incompatible)
void ADDON::CAddonMgr::OnPostUnInstall | ( | const std::string & | id | ) |
Hook for clearing internal state after uninstall.
void ADDON::CAddonMgr::PublishEventAutoUpdateStateChanged | ( | const std::string & | id | ) |
void ADDON::CAddonMgr::PublishInstanceAdded | ( | const std::string & | addonId, |
AddonInstanceId | instanceId ) |
Launches event AddonEvent::InstanceAdded.
This is called when a new instance is added in add-on settings.
[in] | addonId | Add-on id to pass through |
[in] | instanceId | Identifier of the add-on instance |
void ADDON::CAddonMgr::PublishInstanceRemoved | ( | const std::string & | addonId, |
AddonInstanceId | instanceId ) |
Launches event AddonEvent::InstanceRemoved.
This is called when an instance is removed in add-on settings.
[in] | addonId | Add-on id to pass through |
[in] | instanceId | Identifier of the add-on instance |
bool ADDON::CAddonMgr::RegisterAddonMgrCallback | ( | AddonType | type, |
IAddonMgrCallback * | cb ) |
|
inline |
bool ADDON::CAddonMgr::ReloadSettings | ( | const std::string & | addonId, |
AddonInstanceId | instanceId ) |
bool ADDON::CAddonMgr::RemoveAllUpdateRulesFromList | ( | const std::string & | id | ) |
bool ADDON::CAddonMgr::RemoveUpdateRuleFromList | ( | const std::string & | id, |
AddonUpdateRule | updateRule ) |
bool ADDON::CAddonMgr::ServicesHasStarted | ( | ) | const |
bool ADDON::CAddonMgr::SetAddonOrigin | ( | const std::string & | addonId, |
const std::string & | repoAddonId, | ||
bool | isUpdate ) |
Addon update and install management.
Parts inside here are used for changes about addon system.
Update addon origin data.
This becomes called from CAddonInstallJob to set the source repo and if update, to set also the date.
[in] | addonId | Identifier of addon |
[in] | repoAddonId | Identifier of related repository addon |
[in] | isUpdate | If call becomes done on already installed addon and update only. |
Currently listed call sources:
bool ADDON::CAddonMgr::UnloadAddon | ( | const std::string & | addonId | ) |
Unload addon from the system. Returns true if it was unloaded, otherwise false.
|
inline |
bool ADDON::CAddonMgr::UpdateDisabledReason | ( | const std::string & | id, |
AddonDisabledReason | newDisabledReason ) |
Updates reason for a disabled addon. Returns true on success, false on failure.
void ADDON::CAddonMgr::UpdateLastUsed | ( | const std::string & | id | ) |