Skip to content

Commit

Permalink
fixed: use auto-generated thumbs for the recentlyadded items on home …
Browse files Browse the repository at this point in the history
…screen if no thumbnail is available (closes #12285)
  • Loading branch information
mkortstiege committed Dec 21, 2011
1 parent 067004b commit 4cd482d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 14 additions & 2 deletions xbmc/utils/RecentlyAddedJob.cpp
Expand Up @@ -65,13 +65,17 @@ bool CRecentlyAddedJob::UpdateVideo()
strRating.Format("%.1f", item->GetVideoInfoTag()->m_fRating);

home->SetProperty("LatestMovie." + value + ".Title" , item->GetLabel());
home->SetProperty("LatestMovie." + value + ".Thumb" , item->GetThumbnailImage());
home->SetProperty("LatestMovie." + value + ".Rating" , strRating);
home->SetProperty("LatestMovie." + value + ".Year" , item->GetVideoInfoTag()->m_iYear);
home->SetProperty("LatestMovie." + value + ".Plot" , item->GetVideoInfoTag()->m_strPlot);
home->SetProperty("LatestMovie." + value + ".RunningTime" , item->GetVideoInfoTag()->m_strRuntime);
home->SetProperty("LatestMovie." + value + ".Path" , item->GetVideoInfoTag()->m_strFileNameAndPath);
home->SetProperty("LatestMovie." + value + ".Trailer" , item->GetVideoInfoTag()->m_strTrailer);

if (!item->HasThumbnail())
m_thumbLoader.LoadItem(item.get());

home->SetProperty("LatestMovie." + value + ".Thumb" , item->GetThumbnailImage());
home->SetProperty("LatestMovie." + value + ".Fanart" , item->GetCachedFanart());
}
}
Expand Down Expand Up @@ -115,6 +119,10 @@ bool CRecentlyAddedJob::UpdateVideo()
home->SetProperty("LatestEpisode." + value + ".EpisodeSeason" , EpisodeSeason);
home->SetProperty("LatestEpisode." + value + ".EpisodeNumber" , EpisodeNumber);
home->SetProperty("LatestEpisode." + value + ".Path" , item->GetVideoInfoTag()->m_strFileNameAndPath);

if (!item->HasThumbnail())
m_thumbLoader.LoadItem(item.get());

home->SetProperty("LatestEpisode." + value + ".Thumb" , item->GetThumbnailImage());
home->SetProperty("LatestEpisode." + value + ".Fanart" , item->GetCachedFanart());
}
Expand Down Expand Up @@ -147,12 +155,16 @@ bool CRecentlyAddedJob::UpdateVideo()
value.Format("%i", i + 1);

home->SetProperty("LatestMusicVideo." + value + ".Title" , item->GetLabel());
home->SetProperty("LatestMusicVideo." + value + ".Thumb" , item->GetThumbnailImage());
home->SetProperty("LatestMusicVideo." + value + ".Year" , item->GetVideoInfoTag()->m_iYear);
home->SetProperty("LatestMusicVideo." + value + ".Plot" , item->GetVideoInfoTag()->m_strPlot);
home->SetProperty("LatestMusicVideo." + value + ".RunningTime" , item->GetVideoInfoTag()->m_strRuntime);
home->SetProperty("LatestMusicVideo." + value + ".Path" , item->GetVideoInfoTag()->m_strFileNameAndPath);
home->SetProperty("LatestMusicVideo." + value + ".Artist" , item->GetVideoInfoTag()->m_strArtist);

if (!item->HasThumbnail())
m_thumbLoader.LoadItem(item.get());

home->SetProperty("LatestMusicVideo." + value + ".Thumb" , item->GetThumbnailImage());
home->SetProperty("LatestMusicVideo." + value + ".Fanart" , item->GetCachedFanart());
}
}
Expand Down
3 changes: 3 additions & 0 deletions xbmc/utils/RecentlyAddedJob.h
Expand Up @@ -20,6 +20,7 @@
*
*/

#include "ThumbLoader.h"
#include "Job.h"

enum ERecentlyAddedFlag
Expand All @@ -37,6 +38,8 @@ class CRecentlyAddedJob : public CJob
bool UpdateMusic();
bool UpdateTotal();
virtual bool DoWork();
protected:
CVideoThumbLoader m_thumbLoader;
private:
int m_flag;
};

3 comments on commit 4cd482d

@Hitcher
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another related bug occurs if the library is updating while XBMC is on the Home screen - the thumb doesn't get set even if one is scraped (I assume it's because it hasn't been scraped at the time as the item gets added to the recently added list).

@mkortstiege
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Will have a look at it.

@mkortstiege
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 227d928

Please sign in to comment.