本文整理汇总了C++中addon::ScraperPtr::IsNoop方法的典型用法代码示例。如果您正苦于以下问题:C++ ScraperPtr::IsNoop方法的具体用法?C++ ScraperPtr::IsNoop怎么用?C++ ScraperPtr::IsNoop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addon::ScraperPtr
的用法示例。
在下文中一共展示了ScraperPtr::IsNoop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Work
bool CVideoLibraryRefreshingJob::Work(CVideoDatabase &db)
{
if (m_item == nullptr)
return false;
// determine the scraper for the item's path
VIDEO::SScanSettings scanSettings;
ADDON::ScraperPtr scraper = db.GetScraperForPath(m_item->GetPath(), scanSettings);
if (scraper == nullptr)
return false;
// copy the scraper in case we need it again
ADDON::ScraperPtr originalScraper(scraper);
// get the item's correct title
std::string itemTitle = m_searchTitle;
if (itemTitle.empty())
itemTitle = m_item->GetMovieName(scanSettings.parent_name);
CScraperUrl scraperUrl;
VIDEO::CVideoInfoScanner scanner;
bool needsRefresh = m_forceRefresh;
bool hasDetails = false;
bool ignoreNfo = m_ignoreNfo;
// run this in a loop in case we need to refresh again
bool failure = false;
do
{
if (!ignoreNfo)
{
// check if there's an NFO for the item
CNfoFile::NFOResult nfoResult = scanner.CheckForNFOFile(m_item.get(), scanSettings.parent_name_root, scraper, scraperUrl);
// if there's no NFO remember it in case we have to refresh again
if (nfoResult == CNfoFile::ERROR_NFO)
ignoreNfo = true;
else if (nfoResult != CNfoFile::NO_NFO)
hasDetails = true;
// if we are performing a forced refresh ask the user to choose between using a valid NFO and a valid scraper
if (needsRefresh && IsModal() && !scraper->IsNoop() &&
(nfoResult == CNfoFile::URL_NFO || nfoResult == CNfoFile::COMBINED_NFO || nfoResult == CNfoFile::FULL_NFO))
{
int heading = 20159;
if (scraper->Content() == CONTENT_MOVIES)
heading = 13346;
else if (scraper->Content() == CONTENT_TVSHOWS)
heading = m_item->m_bIsFolder ? 20351 : 20352;
else if (scraper->Content() == CONTENT_MUSICVIDEOS)
heading = 20393;
if (CGUIDialogYesNo::ShowAndGetInput(heading, 20446))
{
hasDetails = false;
ignoreNfo = true;
scraperUrl.Clear();
scraper = originalScraper;
}
}
}
// no need to re-fetch the episode guide for episodes
if (scraper->Content() == CONTENT_TVSHOWS && !m_item->m_bIsFolder)
hasDetails = true;
// if we don't have an url or need to refresh anyway do the web search
if (!hasDetails && (needsRefresh || scraperUrl.m_url.empty()))
{
SetTitle(StringUtils::Format(g_localizeStrings.Get(197).c_str(), scraper->Name().c_str()));
SetText(itemTitle);
SetProgress(0);
// clear any cached data from the scraper
scraper->ClearCache();
// create the info downloader for the scraper
CVideoInfoDownloader infoDownloader(scraper);
// try to find a matching item
MOVIELIST itemResultList;
int result = infoDownloader.FindMovie(itemTitle, itemResultList, GetProgressDialog());
// close the progress dialog
MarkFinished();
if (result > 0)
{
// there are multiple matches for the item
if (!itemResultList.empty())
{
// choose the first match
if (!IsModal())
scraperUrl = itemResultList.at(0);
else
{
// ask the user what to do
CGUIDialogSelect* selectDialog = static_cast<CGUIDialogSelect*>(g_windowManager.GetWindow(WINDOW_DIALOG_SELECT));
selectDialog->Reset();
selectDialog->SetHeading(scraper->Content() == CONTENT_TVSHOWS ? 20356 : 196);
for (const auto& itemResult : itemResultList)
//.........这里部分代码省略.........