Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
ADDON::CScraper Class Reference

#include <Scraper.h>

Inheritance diagram for ADDON::CScraper:
ADDON::CAddon ADDON::IAddon

Public Member Functions

 CScraper (const AddonInfoPtr &addonInfo, AddonType addonType)
 
bool SetPathSettings (CONTENT_TYPE content, const std::string &xml)
 Set the scraper settings for a particular path from an XML string Loads the default and user settings (if not already loaded) and, if the given XML string is non-empty, overrides the user settings with the XML.
 
std::string GetPathSettings ()
 Get the scraper settings for a particular path in the form of an XML string Loads the default and user settings (if not already loaded) and returns the user settings in the form or an XML string.
 
void ClearCache ()
 Clear any previously cached results for this scraper Any previously cached files are cleared if they have been cached for longer than the specified cachepersistence.
 
CONTENT_TYPE Content () const
 
bool RequiresSettings () const
 
bool Supports (const CONTENT_TYPE &content) const
 
bool IsInUse () const override
 
bool IsNoop ()
 
bool IsPython () const
 
CScraperUrl NfoUrl (const std::string &sNfoContent)
 
CScraperUrl ResolveIDToUrl (const std::string &externalID)
 Resolve an external ID (e.g. MusicBrainz IDs) to a URL using scrapers If we have an ID in hand, e.g. MusicBrainz IDs or TheTVDB Season IDs we can get directly to a URL instead of searching by name and choosing from the search results. The correct scraper type should be used to get the right URL for a given ID, so we can differentiate albums, artists, TV Seasons, etc.
 
std::vector< CScraperUrlFindMovie (XFILE::CCurlFile &fcurl, const std::string &movieTitle, int movieYear, bool fFirst)
 
std::vector< MUSIC_GRABBER::CMusicAlbumInfoFindAlbum (XFILE::CCurlFile &fcurl, const std::string &sAlbum, const std::string &sArtist="")
 
std::vector< MUSIC_GRABBER::CMusicArtistInfoFindArtist (XFILE::CCurlFile &fcurl, const std::string &sArtist)
 
KODI::VIDEO::EPISODELIST GetEpisodeList (XFILE::CCurlFile &fcurl, const CScraperUrl &scurl)
 
bool GetVideoDetails (XFILE::CCurlFile &fcurl, const std::unordered_map< std::string, std::string > &uniqueIDs, const CScraperUrl &scurl, bool fMovie, CVideoInfoTag &video)
 
bool GetAlbumDetails (XFILE::CCurlFile &fcurl, const CScraperUrl &scurl, CAlbum &album)
 
bool GetArtistDetails (XFILE::CCurlFile &fcurl, const CScraperUrl &scurl, const std::string &sSearch, CArtist &artist)
 
bool GetArtwork (XFILE::CCurlFile &fcurl, CVideoInfoTag &details)
 
- Public Member Functions inherited from ADDON::CAddon
 CAddon (const AddonInfoPtr &addonInfo, AddonType addonType)
 
 ~CAddon () override=default
 
AddonType MainType () const override
 To get the main type of this addon.
 
AddonType Type () const override
 To get the on this CAddon class processed addon type.
 
bool HasType (AddonType type) const override
 To check complete addon (not only this) contains a type.
 
bool HasMainType (AddonType type) const override
 To check complete addon (not only this) has a specific type defined in its first extension point including the provided subcontent e.g. video or audio.
 
const CAddonTypeType (AddonType type) const
 The get for given addon type information and extension data.
 
std::string ID () const override
 
std::string Name () const override
 
bool IsBinary () const override
 
CAddonVersion Version () const override
 
CAddonVersion MinVersion () const override
 
std::string Summary () const override
 
std::string Description () const override
 
std::string Path () const override
 
std::string Profile () const override
 
std::string LibPath () const override
 
std::string Author () const override
 
std::string ChangeLog () const override
 
std::string Icon () const override
 
ArtMap Art () const override
 
std::vector< std::string > Screenshots () const override
 
std::string Disclaimer () const override
 
AddonLifecycleState LifecycleState () const override
 
std::string LifecycleStateDescription () const override
 
CDateTime InstallDate () const override
 
CDateTime LastUpdated () const override
 
CDateTime LastUsed () const override
 
std::string Origin () const override
 
std::string OriginName () const override
 
uint64_t PackageSize () const override
 
const InfoMapExtraInfo () const override
 
const std::vector< DependencyInfo > & GetDependencies () const override
 
std::string FanArt () const override
 
bool SupportsMultipleInstances () const override
 Check add-on for support from independent work instances.
 
AddonInstanceSupport InstanceUseType () const override
 Return the used instance path type of the add-on type.
 
std::vector< AddonInstanceIdGetKnownInstanceIds () const override
 Gives active, independently working instance identifiers for this add-on.
 
bool SupportsInstanceSettings () const override
 Check whether the add-on supports individual settings per add-on instance.
 
bool DeleteInstanceSettings (AddonInstanceId instance) override
 Delete selected instance settings from storage.
 
bool CanHaveAddonOrInstanceSettings () override
 Check whether this add-on can be configured by the user.
 
bool HasSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 Check whether this add-on can be configured by the user.
 
bool HasUserSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 Check whether the user has configured this add-on or not.
 
bool SaveSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 Save any user configured settings.
 
void UpdateSetting (const std::string &key, const std::string &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new value.
 
bool UpdateSettingBool (const std::string &key, bool value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new boolean value.
 
bool UpdateSettingInt (const std::string &key, int value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new integer value.
 
bool UpdateSettingNumber (const std::string &key, double value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new number value.
 
bool UpdateSettingString (const std::string &key, const std::string &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Update a user-configured setting with a new string value.
 
std::string GetSetting (const std::string &key, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value.
 
bool GetSettingBool (const std::string &key, bool &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value as boolean.
 
bool GetSettingInt (const std::string &key, int &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value as integer.
 
bool GetSettingNumber (const std::string &key, double &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value as number.
 
bool GetSettingString (const std::string &key, std::string &value, AddonInstanceId id=ADDON_SETTINGS_ID) override
 Retrieve a particular settings value as string.
 
std::shared_ptr< CAddonSettingsGetSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 
CAddonVersion GetDependencyVersion (const std::string &dependencyID) const override
 get the required version of a dependency.
 
bool MeetsVersion (const CAddonVersion &versionMin, const CAddonVersion &version) const override
 return whether or not this addon satisfies the given version requirements
 
bool ReloadSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 
void ResetSettings (AddonInstanceId id=ADDON_SETTINGS_ID) override
 
AddonPtr GetRunningInstance () const override
 retrieve the running instance of an add-on if it persists while running.
 
void OnPreInstall () override
 
void OnPostInstall (bool update, bool modal) override
 
void OnPreUnInstall () override
 
void OnPostUnInstall () override
 
- Public Member Functions inherited from ADDON::IAddon
virtual ~IAddon ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from ADDON::CAddon
virtual bool SettingsInitialized (AddonInstanceId id=ADDON_SETTINGS_ID) const
 Whether or not the settings have been initialized.
 
virtual bool SettingsLoaded (AddonInstanceId id=ADDON_SETTINGS_ID) const
 Whether or not the settings have been loaded.
 
bool LoadSettings (bool bForce, bool loadUserSettings, AddonInstanceId id=ADDON_SETTINGS_ID)
 Load the default settings and override these with any previously configured user settings.
 
virtual bool LoadUserSettings (AddonInstanceId id=ADDON_SETTINGS_ID)
 Load the user settings.
 
virtual bool HasSettingsToSave (AddonInstanceId id=ADDON_SETTINGS_ID) const
 Whether there are settings to be saved.
 
virtual bool SettingsFromXML (const CXBMCTinyXML &doc, bool loadDefaults, AddonInstanceId id=ADDON_SETTINGS_ID)
 Parse settings from an XML document.
 
virtual bool SettingsToXML (CXBMCTinyXML &doc, AddonInstanceId id=ADDON_SETTINGS_ID) const
 Write settings into an XML document.
 
- Protected Attributes inherited from ADDON::CAddon
const AddonInfoPtr m_addonInfo
 

Constructor & Destructor Documentation

◆ CScraper()

ADDON::CScraper::CScraper ( const AddonInfoPtr & addonInfo,
AddonType addonType )
explicit

Member Function Documentation

◆ ClearCache()

void ADDON::CScraper::ClearCache ( )

Clear any previously cached results for this scraper Any previously cached files are cleared if they have been cached for longer than the specified cachepersistence.

◆ Content()

CONTENT_TYPE ADDON::CScraper::Content ( ) const
inline

◆ FindAlbum()

std::vector< CMusicAlbumInfo > ADDON::CScraper::FindAlbum ( XFILE::CCurlFile & fcurl,
const std::string & sAlbum,
const std::string & sArtist = "" )

◆ FindArtist()

std::vector< CMusicArtistInfo > ADDON::CScraper::FindArtist ( XFILE::CCurlFile & fcurl,
const std::string & sArtist )

◆ FindMovie()

std::vector< CScraperUrl > ADDON::CScraper::FindMovie ( XFILE::CCurlFile & fcurl,
const std::string & movieTitle,
int movieYear,
bool fFirst )

◆ GetAlbumDetails()

bool ADDON::CScraper::GetAlbumDetails ( XFILE::CCurlFile & fcurl,
const CScraperUrl & scurl,
CAlbum & album )

◆ GetArtistDetails()

bool ADDON::CScraper::GetArtistDetails ( XFILE::CCurlFile & fcurl,
const CScraperUrl & scurl,
const std::string & sSearch,
CArtist & artist )

◆ GetArtwork()

bool ADDON::CScraper::GetArtwork ( XFILE::CCurlFile & fcurl,
CVideoInfoTag & details )

◆ GetEpisodeList()

VIDEO::EPISODELIST ADDON::CScraper::GetEpisodeList ( XFILE::CCurlFile & fcurl,
const CScraperUrl & scurl )

◆ GetPathSettings()

std::string ADDON::CScraper::GetPathSettings ( )

Get the scraper settings for a particular path in the form of an XML string Loads the default and user settings (if not already loaded) and returns the user settings in the form or an XML string.

Returns
a string containing the XML settings
See also
SetPathSettings

◆ GetVideoDetails()

bool ADDON::CScraper::GetVideoDetails ( XFILE::CCurlFile & fcurl,
const std::unordered_map< std::string, std::string > & uniqueIDs,
const CScraperUrl & scurl,
bool fMovie,
CVideoInfoTag & video )

◆ IsInUse()

bool ADDON::CScraper::IsInUse ( ) const
overridevirtual

Reimplemented from ADDON::CAddon.

◆ IsNoop()

bool ADDON::CScraper::IsNoop ( )

◆ IsPython()

bool ADDON::CScraper::IsPython ( ) const
inline

◆ NfoUrl()

CScraperUrl ADDON::CScraper::NfoUrl ( const std::string & sNfoContent)

◆ RequiresSettings()

bool ADDON::CScraper::RequiresSettings ( ) const
inline

◆ ResolveIDToUrl()

CScraperUrl ADDON::CScraper::ResolveIDToUrl ( const std::string & externalID)

Resolve an external ID (e.g. MusicBrainz IDs) to a URL using scrapers If we have an ID in hand, e.g. MusicBrainz IDs or TheTVDB Season IDs we can get directly to a URL instead of searching by name and choosing from the search results. The correct scraper type should be used to get the right URL for a given ID, so we can differentiate albums, artists, TV Seasons, etc.

Parameters
externalIDthe external ID - e.g. MusicBrainzArtist/AlbumID
Returns
a populated URL pointing to the details page for the given ID or an empty URL if we couldn't resolve the ID.

◆ SetPathSettings()

bool ADDON::CScraper::SetPathSettings ( CONTENT_TYPE content,
const std::string & xml )

Set the scraper settings for a particular path from an XML string Loads the default and user settings (if not already loaded) and, if the given XML string is non-empty, overrides the user settings with the XML.

Parameters
contentContent type of the path
xmlstring of XML with the settings. If non-empty this overrides any saved user settings.
Returns
true if settings are available, false otherwise
See also
GetPathSettings

◆ Supports()

bool ADDON::CScraper::Supports ( const CONTENT_TYPE & content) const

The documentation for this class was generated from the following files: