Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

recentlyadded: save queries for season id and season/show thumbs

Use the idSeason value available through episodeview instead of having to
retrieve it for every episode. Furthermore remember the already retrieved
season/show thumbs to save querying the same images again.
  • Loading branch information...
commit f95c66b4d497ef424cabfbdaf52e11e2926bb9a7 1 parent b5b9fa8
@Montellese authored
Showing with 18 additions and 5 deletions.
  1. +18 −5 xbmc/utils/RecentlyAddedJob.cpp
View
23 xbmc/utils/RecentlyAddedJob.cpp
@@ -100,7 +100,8 @@ bool CRecentlyAddedJob::UpdateVideo()
CFileItemList TVShowItems;
if (videodatabase.GetRecentlyAddedEpisodesNav("videodb://5/", TVShowItems, NUM_ITEMS))
- {
+ {
+ std::map<int, std::string> showThumbs;
for (; i < TVShowItems.Size(); ++i)
{
CFileItemPtr item = TVShowItems.Get(i);
@@ -109,7 +110,6 @@ bool CRecentlyAddedJob::UpdateVideo()
CStdString EpisodeNo;
CStdString value;
CStdString strRating;
- CStdString strSeason;
EpisodeNo.Format("s%02de%02d", EpisodeSeason, EpisodeNumber);
value.Format("%i", i + 1);
strRating.Format("%.1f", item->GetVideoInfoTag()->m_fRating);
@@ -128,9 +128,22 @@ bool CRecentlyAddedJob::UpdateVideo()
if (!item->HasThumbnail())
m_thumbLoader.LoadItem(item.get());
- int seasonID = videodatabase.GetSeasonId(item->GetVideoInfoTag()->m_iIdShow, EpisodeSeason);
- std::string seasonThumb = videodatabase.GetArtForItem(seasonID, "season", "thumb");
- std::string showThumb = videodatabase.GetArtForItem(item->GetVideoInfoTag()->m_iIdShow, "tvshow", "thumb");
+ 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);
Please sign in to comment.
Something went wrong with that request. Please try again.