Browse files

factor out CVideoInfoScanner::GetFanart for re-use

  • Loading branch information...
1 parent 4026f96 commit 650637558be66c8190b436a199e39772859b8759 Jonathan Marshall committed Oct 13, 2012
Showing with 13 additions and 6 deletions.
  1. +12 −6 xbmc/video/VideoInfoScanner.cpp
  2. +1 −0 xbmc/video/VideoInfoScanner.h
View
18 xbmc/video/VideoInfoScanner.cpp
@@ -1174,12 +1174,8 @@ namespace VIDEO
bool isEpisode = (content == CONTENT_TVSHOWS && !pItem->m_bIsFolder);
if (!isEpisode)
{
- CStdString fanart = pItem->GetArt("fanart");
- if (fanart.empty() && useLocal)
- fanart = pItem->FindLocalArt("fanart.jpg", true);
- if (fanart.IsEmpty())
- fanart = movieDetails.m_fanart.GetImageURL();
- if (!fanart.IsEmpty())
+ string fanart = GetFanart(pItem, useLocal);
+ if (!fanart.empty())
art.insert(make_pair("fanart", fanart));
}
@@ -1232,6 +1228,16 @@ namespace VIDEO
return thumb;
}
+ std::string CVideoInfoScanner::GetFanart(CFileItem *pItem, bool useLocal)
+ {
+ std::string fanart = pItem->GetArt("fanart");
+ if (fanart.empty() && useLocal)
+ fanart = pItem->FindLocalArt("fanart.jpg", true);
+ if (fanart.empty())
+ fanart = movieDetails.m_fanart.GetImageURL();
+ return fanart;
+ }
+
INFO_RET CVideoInfoScanner::OnProcessSeriesFolder(EPISODELIST& files, const ADDON::ScraperPtr &scraper, bool useLocal, const CVideoInfoTag& showInfo, CGUIDialogProgress* pDlgProgress /* = NULL */)
{
if (pDlgProgress)
View
1 xbmc/video/VideoInfoScanner.h
@@ -108,6 +108,7 @@ namespace VIDEO
*/
static void GetSeasonThumbs(const CVideoInfoTag &show, std::map<int, std::string> &art, bool useLocal = true);
static std::string GetImage(CFileItem *pItem, bool useLocal, bool bApplyToDir, const std::string &type = "");
+ static std::string GetFanart(CFileItem *pItem, bool useLocal);
protected:
virtual void Process();

0 comments on commit 6506375

Please sign in to comment.