Permalink
Browse files

adds Property(TVShow_Thumb) to listitem + player

  • Loading branch information...
1 parent 95819b6 commit 9301605f388352ffefcfbf617b6b66a7818360a7 Jonathan Marshall committed Jul 7, 2012
Showing with 10 additions and 24 deletions.
  1. +9 −3 xbmc/ThumbLoader.cpp
  2. +1 −15 xbmc/utils/RecentlyAddedJob.cpp
  3. +0 −6 xbmc/video/dialogs/GUIDialogVideoInfo.cpp
View
@@ -388,9 +388,15 @@ bool CVideoThumbLoader::FillLibraryArt(CFileItem *pItem)
// For episodes and seasons, we want to set fanart for that of the show
if (!pItem->HasProperty("fanart_image") && tag.m_iIdShow >= 0)
{
- string fanart = m_database->GetArtForItem(tag.m_iIdShow, "tvshow", "fanart");
- if (!fanart.empty())
- pItem->SetProperty("fanart_image", fanart);
+ map<string, string> showArt;
+ if (m_database->GetArtForItem(tag.m_iIdShow, "tvshow", showArt))
+ {
+ map<string, string>::iterator i = showArt.find("fanart");
+ if (i != showArt.end())
+ pItem->SetProperty("fanart_image", i->second);
+ if ((i = showArt.find("thumb")) != showArt.end())
+ pItem->SetProperty("tvshowthumb", i->second);
+ }
}
m_database->Close();
}
@@ -101,7 +101,6 @@ bool CRecentlyAddedJob::UpdateVideo()
if (videodatabase.GetRecentlyAddedEpisodesNav("videodb://5/", TVShowItems, NUM_ITEMS))
{
- std::map<int, std::string> showThumbs;
for (; i < TVShowItems.Size(); ++i)
{
CFileItemPtr item = TVShowItems.Get(i);
@@ -128,25 +127,12 @@ bool CRecentlyAddedJob::UpdateVideo()
if (!item->HasThumbnail())
m_thumbLoader.LoadItem(item.get());
- std::string showThumb;
- if (item->GetVideoInfoTag()->m_iIdShow > 0)
- {
- std::map<int, std::string>::const_iterator thumbIter;
- if ((thumbIter = showThumbs.find(item->GetVideoInfoTag()->m_iIdShow)) != showThumbs.end())
- showThumb = thumbIter->second;
- else
- {
- showThumb = videodatabase.GetArtForItem(item->GetVideoInfoTag()->m_iIdShow, "tvshow", "thumb");
- showThumbs[item->GetVideoInfoTag()->m_iIdShow] = showThumb;
- }
- }
-
std::string seasonThumb;
if (item->GetVideoInfoTag()->m_iIdSeason > 0)
seasonThumb = videodatabase.GetArtForItem(item->GetVideoInfoTag()->m_iIdSeason, "season", "thumb");
home->SetProperty("LatestEpisode." + value + ".Thumb" , item->GetThumbnailImage());
- home->SetProperty("LatestEpisode." + value + ".ShowThumb" , showThumb);
+ home->SetProperty("LatestEpisode." + value + ".ShowThumb" , item->GetProperty("tvshowthumb"));
home->SetProperty("LatestEpisode." + value + ".SeasonThumb" , seasonThumb);
home->SetProperty("LatestEpisode." + value + ".Fanart" , item->GetProperty("fanart_image"));
}
@@ -309,12 +309,6 @@ void CGUIDialogVideoInfo::SetMovie(const CFileItem *item)
if (!thumb.empty())
m_movieItem->SetProperty("seasonthumb", thumb);
}
- if (m_movieItem->GetVideoInfoTag()->m_iIdShow > -1)
- {
- string thumb = db.GetArtForItem(m_movieItem->GetVideoInfoTag()->m_iIdShow, "tvshow", "thumb");
- if (!thumb.empty())
- m_movieItem->SetProperty("tvshowthumb", thumb);
- }
db.Close();
}
}

0 comments on commit 9301605

Please sign in to comment.