本文整理汇总了C++中CGUIDialogMusicInfo::SetScrapedInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogMusicInfo::SetScrapedInfo方法的具体用法?C++ CGUIDialogMusicInfo::SetScrapedInfo怎么用?C++ CGUIDialogMusicInfo::SetScrapedInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogMusicInfo
的用法示例。
在下文中一共展示了CGUIDialogMusicInfo::SetScrapedInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoWork
// Refresh album/artist information including art types list
bool DoWork() override
{
CGUIDialogMusicInfo *dialog = CServiceBroker::GetGUI()->GetWindowManager().
GetWindow<CGUIDialogMusicInfo>(WINDOW_DIALOG_MUSIC_INFO);
if (!dialog)
return false;
if (dialog->IsCancelled())
return false;
CFileItemPtr m_item = dialog->GetCurrentListItem();
CMusicInfoTag& tag = *m_item->GetMusicInfoTag();
CArtist& m_artist = dialog->GetArtist();
CAlbum& m_album = dialog->GetAlbum();
CGUIDialogProgress* dlgProgress = GetProgressDialog();
CMusicDatabase database;
database.Open();
if (tag.GetType() == MediaTypeArtist)
{
ADDON::ScraperPtr scraper;
if (!database.GetScraper(m_artist.idArtist, CONTENT_ARTISTS, scraper))
return false;
if (dlgProgress->IsCanceled())
return false;
database.ClearArtistLastScrapedTime(m_artist.idArtist);
if (dlgProgress->IsCanceled())
return false;
CMusicInfoScanner scanner;
if (scanner.UpdateArtistInfo(m_artist, scraper, true, dlgProgress) != CInfoScanner::INFO_ADDED)
return false;
else
// Tell info dialog, so can show message
dialog->SetScrapedInfo(true);
if (dlgProgress->IsCanceled())
return false;
//That changed DB and m_artist, now update dialog item with new info and art
tag.SetArtist(m_artist);
CMusicDatabase::SetPropertiesFromArtist(*m_item, m_artist);
// Fetch artist discography as scraped from online sources, but always
// include all the albums in the music library
dialog->SetDiscography(database);
}
else
{
// tag.GetType == MediaTypeAlbum
ADDON::ScraperPtr scraper;
if (!database.GetScraper(m_album.idAlbum, CONTENT_ALBUMS, scraper))
return false;
if (dlgProgress->IsCanceled())
return false;
database.ClearAlbumLastScrapedTime(m_album.idAlbum);
if (dlgProgress->IsCanceled())
return false;
CMusicInfoScanner scanner;
if (scanner.UpdateAlbumInfo(m_album, scraper, true, GetProgressDialog()) != CInfoScanner::INFO_ADDED)
return false;
else
// Tell info dialog, so can show message
dialog->SetScrapedInfo(true);
if (dlgProgress->IsCanceled())
return false;
//That changed DB and m_album, now update dialog item with new info and art
// Album songs are unchanged by refresh (even with Musicbrainz sync?)
tag.SetAlbum(m_album);
CMusicDatabase::SetPropertiesFromAlbum(*m_item, m_album);
// Set the list of songs and related art
dialog->SetSongs(m_album.songs);
}
database.Close();
if (dlgProgress->IsCanceled())
return false;
/*
Load current art (to CGUIListItem.m_art)
For albums this includes related artist(s) art and artist fanart set as
fallback album fanart.
Clear item art first to ensure fresh not cached/partial art
*/
m_item->ClearArt();
CMusicThumbLoader loader;
loader.LoadItem(m_item.get());
if (dlgProgress->IsCanceled())
return false;
// Fill vector of possible art types with current art, when it exists,
// for display on the art type selection dialog
CFileItemList artlist;
MUSIC_UTILS::FillArtTypesList(*m_item, artlist);
dialog->SetArtTypeList(artlist);
if (dialog->IsCancelled())
return false;
//.........这里部分代码省略.........