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

#include <VideoInfoDownloader.h>

Inheritance diagram for CVideoInfoDownloader:
CThread

Public Member Functions

 CVideoInfoDownloader (const ADDON::ScraperPtr &scraper)
 
 ~CVideoInfoDownloader () override
 
int FindMovie (const std::string &movieTitle, int movieYear, MOVIELIST &movielist, CGUIDialogProgress *pProgress=NULL)
 Do a search for matching media items (possibly asynchronously) with our scraper.
 
bool GetArtwork (CVideoInfoTag &details)
 Fetch art URLs for an item with our scraper.
 
bool GetDetails (const std::unordered_map< std::string, std::string > &uniqueIDs, const CScraperUrl &url, CVideoInfoTag &movieDetails, CGUIDialogProgress *pProgress=NULL)
 
bool GetEpisodeDetails (const CScraperUrl &url, CVideoInfoTag &movieDetails, CGUIDialogProgress *pProgress=NULL)
 
bool GetEpisodeList (const CScraperUrl &url, KODI::VIDEO::EPISODELIST &details, CGUIDialogProgress *pProgress=NULL)
 
- Public Member Functions inherited from CThread
 CThread (IRunnable *pRunnable, const char *ThreadName)
 
virtual ~CThread ()
 
void Create (bool bAutoDelete=false)
 
template<typename Rep , typename Period >
void Sleep (std::chrono::duration< Rep, Period > duration)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
bool Join (std::chrono::milliseconds duration)
 
bool SetPriority (const ThreadPriority &priority)
 Set the threads priority. This uses the platforms native threading library to do so.
 
virtual void OnException ()
 

Static Public Member Functions

static void ShowErrorDialog (const ADDON::CScraperError &sce)
 
- Static Public Member Functions inherited from CThread
static const std::thread::id GetCurrentThreadId ()
 
static CThreadGetCurrentThread ()
 

Protected Types

enum  LOOKUP_STATE {
  DO_NOTHING = 0 , FIND_MOVIE = 1 , GET_DETAILS = 2 , GET_EPISODE_LIST = 3 ,
  GET_EPISODE_DETAILS = 4
}
 
- Protected Types inherited from CThread
enum  WaitResponse { WAIT_INTERRUPTED = -1 , WAIT_SIGNALED = 0 , WAIT_TIMEDOUT = 1 }
 

Protected Member Functions

void Process () override
 
void CloseThread ()
 
int InternalFindMovie (const std::string &movieTitle, int movieYear, MOVIELIST &movielist, bool cleanChars=true)
 
- Protected Member Functions inherited from CThread
 CThread (const char *ThreadName)
 
virtual void OnStartup ()
 
virtual void OnExit ()
 
WaitResponse AbortableWait (CEvent &event, std::chrono::milliseconds duration=std::chrono::milliseconds(-1))
 

Protected Attributes

XFILE::CCurlFilem_http
 
std::string m_movieTitle
 
int m_movieYear
 
std::unordered_map< std::string, std::string > m_uniqueIDs
 
MOVIELIST m_movieList
 
CVideoInfoTag m_movieDetails
 
CScraperUrl m_url
 
KODI::VIDEO::EPISODELIST m_episode
 
LOOKUP_STATE m_state = DO_NOTHING
 
int m_found = 0
 
ADDON::ScraperPtr m_info
 
- Protected Attributes inherited from CThread
std::atomic< boolm_bStop
 

Member Enumeration Documentation

◆ LOOKUP_STATE

Enumerator
DO_NOTHING 
FIND_MOVIE 
GET_DETAILS 
GET_EPISODE_LIST 
GET_EPISODE_DETAILS 

Constructor & Destructor Documentation

◆ CVideoInfoDownloader()

CVideoInfoDownloader::CVideoInfoDownloader ( const ADDON::ScraperPtr & scraper)
explicit

◆ ~CVideoInfoDownloader()

CVideoInfoDownloader::~CVideoInfoDownloader ( )
override

Member Function Documentation

◆ CloseThread()

void CVideoInfoDownloader::CloseThread ( )
protected

◆ FindMovie()

int CVideoInfoDownloader::FindMovie ( const std::string & movieTitle,
int movieYear,
MOVIELIST & movielist,
CGUIDialogProgress * pProgress = NULL )

Do a search for matching media items (possibly asynchronously) with our scraper.

Parameters
movieTitletitle of the media item to look for
movieYearyear of the media item to look for (-1 if not known)
movielist[out] list of results to fill. May be empty on success.
pProgressprogress bar to update as we go. If NULL we run on thread, if non-NULL we run off thread.
Returns
1 on success, -1 on a scraper-specific error, 0 on some other error

◆ GetArtwork()

bool CVideoInfoDownloader::GetArtwork ( CVideoInfoTag & details)

Fetch art URLs for an item with our scraper.

Parameters
detailsthe video info tag structure to fill with art.
Returns
true on success, false on failure.

◆ GetDetails()

bool CVideoInfoDownloader::GetDetails ( const std::unordered_map< std::string, std::string > & uniqueIDs,
const CScraperUrl & url,
CVideoInfoTag & movieDetails,
CGUIDialogProgress * pProgress = NULL )

◆ GetEpisodeDetails()

bool CVideoInfoDownloader::GetEpisodeDetails ( const CScraperUrl & url,
CVideoInfoTag & movieDetails,
CGUIDialogProgress * pProgress = NULL )

◆ GetEpisodeList()

bool CVideoInfoDownloader::GetEpisodeList ( const CScraperUrl & url,
KODI::VIDEO::EPISODELIST & details,
CGUIDialogProgress * pProgress = NULL )

◆ InternalFindMovie()

int CVideoInfoDownloader::InternalFindMovie ( const std::string & movieTitle,
int movieYear,
MOVIELIST & movielist,
bool cleanChars = true )
protected

◆ Process()

void CVideoInfoDownloader::Process ( void )
overrideprotectedvirtual

Reimplemented from CThread.

◆ ShowErrorDialog()

void CVideoInfoDownloader::ShowErrorDialog ( const ADDON::CScraperError & sce)
static

Member Data Documentation

◆ m_episode

KODI::VIDEO::EPISODELIST CVideoInfoDownloader::m_episode
protected

◆ m_found

int CVideoInfoDownloader::m_found = 0
protected

◆ m_http

XFILE::CCurlFile* CVideoInfoDownloader::m_http
protected

◆ m_info

ADDON::ScraperPtr CVideoInfoDownloader::m_info
protected

◆ m_movieDetails

CVideoInfoTag CVideoInfoDownloader::m_movieDetails
protected

◆ m_movieList

MOVIELIST CVideoInfoDownloader::m_movieList
protected

◆ m_movieTitle

std::string CVideoInfoDownloader::m_movieTitle
protected

◆ m_movieYear

int CVideoInfoDownloader::m_movieYear
protected

◆ m_state

LOOKUP_STATE CVideoInfoDownloader::m_state = DO_NOTHING
protected

◆ m_uniqueIDs

std::unordered_map<std::string, std::string> CVideoInfoDownloader::m_uniqueIDs
protected

◆ m_url

CScraperUrl CVideoInfoDownloader::m_url
protected

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