kodi
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CVideoThumbLoader Class Reference
Inheritance diagram for CVideoThumbLoader:
Inheritance graph
[legend]
Collaboration diagram for CVideoThumbLoader:
Collaboration graph
[legend]

Public Member Functions

void OnLoaderStart () override
 
void OnLoaderFinish () override
 
bool LoadItem (CFileItem *pItem) override
 Look for a thumbnail for pItem. More...
 
bool LoadItemCached (CFileItem *pItem) override
 
bool LoadItemLookup (CFileItem *pItem) override
 
virtual bool FillThumb (CFileItem &item)
 Fill the thumb of a video item First uses a cached thumb from a previous run, then checks for a local thumb and caches it for the next run. More...
 
bool FillLibraryArt (CFileItem &item) override
 helper function to fill the art for a video library item More...
 
- Public Member Functions inherited from CThumbLoader
virtual std::string GetCachedImage (const CFileItem &item, const std::string &type)
 Checks whether the given item has an image listed in the texture database. More...
 
virtual void SetCachedImage (const CFileItem &item, const std::string &type, const std::string &image)
 Associate an image with the given item in the texture database. More...
 
- Public Member Functions inherited from CBackgroundInfoLoader
void Load (CFileItemList &items)
 
bool IsLoading ()
 
void Run () override
 
void SetObserver (IBackgroundLoaderObserver *pObserver)
 
void SetProgressCallback (IProgressCallback *pCallback)
 
void StopThread ()
 
void StopAsync ()
 
- Public Member Functions inherited from IRunnable
virtual void Cancel ()
 

Static Public Member Functions

static std::string GetLocalArt (const CFileItem &item, const std::string &type, bool checkFolder=false)
 Find a particular art type for a given item, optionally checking at the folder level. More...
 
static std::vector< std::string > GetArtTypes (const std::string &type)
 return the available art types for a given media type More...
 
static bool IsValidArtType (const std::string &potentialArtType)
 
static bool IsArtTypeInWhitelist (const std::string &artType, const std::vector< std::string > &whitelist, bool exact)
 
static std::string GetEmbeddedThumbURL (const CFileItem &item)
 helper function to retrieve a thumb URL for embedded video thumbs More...
 

Protected Member Functions

void DetectAndAddMissingItemData (CFileItem &item)
 Tries to detect missing data/info from a file and adds those. More...
 
const ArtMap & GetArtFromCache (const std::string &mediaType, const int id)
 

Protected Attributes

CVideoDatabasem_videoDatabase
 
ArtCache m_artCache
 
- Protected Attributes inherited from CThumbLoader
CTextureDatabasem_textureDatabase
 
- Protected Attributes inherited from CBackgroundInfoLoader
CFileItemListm_pVecItems {nullptr}
 
std::vector< CFileItemPtrm_vecItems
 
CCriticalSection m_lock
 
volatile bool m_bIsLoading {false}
 
volatile bool m_bStop {true}
 
CThreadm_thread {nullptr}
 
IBackgroundLoaderObserverm_pObserver {nullptr}
 
IProgressCallbackm_pProgressCallback {nullptr}
 

Member Function Documentation

◆ DetectAndAddMissingItemData()

void CVideoThumbLoader::DetectAndAddMissingItemData ( CFileItem item)
protected

Tries to detect missing data/info from a file and adds those.

Parameters
itemThe CFileItem to process
Returns
void
Todo:
in case of too many false positives due to using the full path, extract the filename only using string utils

◆ FillLibraryArt()

bool CVideoThumbLoader::FillLibraryArt ( CFileItem item)
overridevirtual

helper function to fill the art for a video library item

Parameters
itema video CFileItem
Returns
true if we fill art, false otherwise
Todo:
Is m_artist set other than musicvideo? Remove this fallback if not.

Reimplemented from CThumbLoader.

◆ FillThumb()

bool CVideoThumbLoader::FillThumb ( CFileItem item)
virtual

Fill the thumb of a video item First uses a cached thumb from a previous run, then checks for a local thumb and caches it for the next run.

Parameters
itemthe CFileItem object to fill
Returns
true if we fill the thumb, false otherwise

◆ GetArtTypes()

std::vector< std::string > CVideoThumbLoader::GetArtTypes ( const std::string &  type)
static

return the available art types for a given media type

Parameters
typethe type of media.
Returns
a vector of art types.
See also
GetLocalArt

◆ GetEmbeddedThumbURL()

std::string CVideoThumbLoader::GetEmbeddedThumbURL ( const CFileItem item)
static

helper function to retrieve a thumb URL for embedded video thumbs

Parameters
itema video CFileItem.
Returns
a URL for the embedded thumb.

◆ GetLocalArt()

std::string CVideoThumbLoader::GetLocalArt ( const CFileItem item,
const std::string &  type,
bool  checkFolder = false 
)
static

Find a particular art type for a given item, optionally checking at the folder level.

Parameters
itemthe CFileItem to search.
typethe type of art to look for.
checkFolderwhether to also check the folder level for files. Defaults to false.
Returns
the art file (if found), else empty.

◆ LoadItem()

bool CVideoThumbLoader::LoadItem ( CFileItem pItem)
overridevirtual

Look for a thumbnail for pItem.

If one does not exist, look for an autogenerated thumbnail. If that does not exist, attempt to autogenerate one. Finally, check for the existence of fanart and set properties accordingly.

Returns
: true if pItem has been modified

Reimplemented from CBackgroundInfoLoader.


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