Skip to content

Commit

Permalink
move tvshowthumb and seasonthumb ListItem.Art to tvshow.thumb and sea…
Browse files Browse the repository at this point in the history
…son.thumb, making tvshow.poster/banner and season.poster/banner also available. Container.TVShowThumb/SeasonThumb are still available for backward compatibility
  • Loading branch information
Jonathan Marshall committed Oct 31, 2012
1 parent 412b018 commit 03423db
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
4 changes: 2 additions & 2 deletions xbmc/GUIInfoManager.cpp
Expand Up @@ -3136,13 +3136,13 @@ CStdString CGUIInfoManager::GetImage(int info, int contextWindow, CStdString *fa
{
CGUIWindow *window = GetWindowWithCondition(contextWindow, WINDOW_CONDITION_IS_MEDIA_WINDOW);
if (window)
return ((CGUIMediaWindow *)window)->CurrentDirectory().GetArt("tvshowthumb");
return ((CGUIMediaWindow *)window)->CurrentDirectory().GetArt("tvshow.thumb");
}
else if (info == CONTAINER_SEASONTHUMB)
{
CGUIWindow *window = GetWindowWithCondition(contextWindow, WINDOW_CONDITION_IS_MEDIA_WINDOW);
if (window)
return ((CGUIMediaWindow *)window)->CurrentDirectory().GetArt("seasonthumb");
return ((CGUIMediaWindow *)window)->CurrentDirectory().GetArt("season.thumb");
}
else if (info == LISTITEM_THUMB || info == LISTITEM_ICON || info == LISTITEM_ACTUAL_ICON ||
info == LISTITEM_OVERLAY || info == LISTITEM_RATING || info == LISTITEM_STAR_RATING)
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/RecentlyAddedJob.cpp
Expand Up @@ -135,7 +135,7 @@ bool CRecentlyAddedJob::UpdateVideo()
seasonThumb = videodatabase.GetArtForItem(item->GetVideoInfoTag()->m_iIdSeason, "season", "thumb");

home->SetProperty("LatestEpisode." + value + ".Thumb" , item->GetArt("thumb"));
home->SetProperty("LatestEpisode." + value + ".ShowThumb" , item->GetArt("tvshowthumb"));
home->SetProperty("LatestEpisode." + value + ".ShowThumb" , item->GetArt("tvshow.thumb"));
home->SetProperty("LatestEpisode." + value + ".SeasonThumb" , seasonThumb);
home->SetProperty("LatestEpisode." + value + ".Fanart" , item->GetArt("fanart"));
}
Expand Down
12 changes: 7 additions & 5 deletions xbmc/video/VideoThumbLoader.cpp
Expand Up @@ -334,11 +334,13 @@ bool CVideoThumbLoader::FillLibraryArt(CFileItem &item)
map<string, string> showArt, cacheArt;
if (m_database->GetArtForItem(tag.m_iIdShow, "tvshow", showArt))
{
map<string, string>::iterator i = showArt.find("fanart");
if (i != showArt.end())
cacheArt.insert(make_pair("fanart", i->second));
if ((i = showArt.find("thumb")) != showArt.end())
cacheArt.insert(make_pair("tvshowthumb", i->second));
for (CGUIListItem::ArtMap::iterator i = showArt.begin(); i != showArt.end(); ++i)
{
if (i->first == "fanart")
cacheArt.insert(*i);
else
cacheArt.insert(make_pair("tvshow." + i->first, i->second));
}
item.AppendArt(cacheArt);
}
m_showArt.insert(make_pair(tag.m_iIdShow, cacheArt));
Expand Down
9 changes: 6 additions & 3 deletions xbmc/video/dialogs/GUIDialogVideoInfo.cpp
Expand Up @@ -315,9 +315,12 @@ void CGUIDialogVideoInfo::SetMovie(const CFileItem *item)
if (seasonID < 0)
seasonID = db.GetSeasonId(m_movieItem->GetVideoInfoTag()->m_iIdShow,
m_movieItem->GetVideoInfoTag()->m_iSeason);
string thumb = db.GetArtForItem(seasonID, "season", "thumb");
if (!thumb.empty())
m_movieItem->SetArt("seasonthumb", thumb);
CGUIListItem::ArtMap thumbs;
if (db.GetArtForItem(seasonID, "season", thumbs))
{
for (CGUIListItem::ArtMap::iterator i = thumbs.begin(); i != thumbs.end(); i++)
m_movieItem->SetArt("season." + i->first, i->second);
}
}
db.Close();
}
Expand Down
32 changes: 20 additions & 12 deletions xbmc/video/windows/GUIWindowVideoNav.cpp
Expand Up @@ -292,12 +292,20 @@ bool CGUIWindowVideoNav::GetDirectory(const CStdString &strDirectory, CFileItemL
map<string, string> art;
if (m_database.GetArtForItem(details.m_iDbId, details.m_type, art))
{
if (art.find("thumb") != art.end())
items.SetArt("tvshowthumb", art["thumb"]);
if (art.find("fanart") != art.end())
items.SetArt("fanart", art["fanart"]);
for (CGUIListItem::ArtMap::iterator i = art.begin(); i != art.end(); ++i)
{
if (i->first == "fanart")
items.SetArt(i->first, i->second);
else
items.SetArt("tvshow." + i->first, i->second);
}
if (node == NODE_TYPE_SEASONS)
{
CFileItem showItem;
showItem.SetArt(art);
items.SetArt("thumb", showItem.GetArt("thumb"));
}
}
CFileItem showItem(details.m_strShowPath, true);

// Grab fanart data
items.SetProperty("fanart_color1", details.m_fanart.GetColor(0));
Expand All @@ -313,18 +321,18 @@ bool CGUIWindowVideoNav::GetDirectory(const CStdString &strDirectory, CFileItemL
items.SetContent("episodes");
// grab the season thumb as the folder thumb
int seasonID = m_database.GetSeasonId(details.m_iDbId, params.GetSeason());
string seasonThumb = m_database.GetArtForItem(seasonID, "season", "thumb");
if (!seasonThumb.empty())
CGUIListItem::ArtMap seasonArt;
if (m_database.GetArtForItem(seasonID, "season", seasonArt))
{
items.SetArt("seasonthumb",seasonThumb);
items.SetArt("thumb", seasonThumb);
for (CGUIListItem::ArtMap::iterator i = art.begin(); i != art.end(); ++i)
items.SetArt("season." + i->first, i->second);
CFileItem seasonItem;
seasonItem.SetArt(seasonArt);
items.SetArt("thumb", seasonItem.GetArt("thumb"));
}
}
else
{
items.SetContent("seasons");
items.SetArt("thumb", showItem.GetArt("thumb"));
}
}
else if (node == NODE_TYPE_TITLE_MOVIES ||
node == NODE_TYPE_RECENTLY_ADDED_MOVIES)
Expand Down

0 comments on commit 03423db

Please sign in to comment.