From 4cd482dafd49ec671d5b46077dbef06eeb67ca3b Mon Sep 17 00:00:00 2001 From: vdrfan Date: Wed, 21 Dec 2011 14:39:16 +0100 Subject: [PATCH] fixed: use auto-generated thumbs for the recentlyadded items on home screen if no thumbnail is available (closes #12285) --- xbmc/utils/RecentlyAddedJob.cpp | 16 ++++++++++++++-- xbmc/utils/RecentlyAddedJob.h | 3 +++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/xbmc/utils/RecentlyAddedJob.cpp b/xbmc/utils/RecentlyAddedJob.cpp index 0e3147f3f0aeb..9cc3a047caade 100644 --- a/xbmc/utils/RecentlyAddedJob.cpp +++ b/xbmc/utils/RecentlyAddedJob.cpp @@ -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()); } } @@ -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()); } @@ -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()); } } diff --git a/xbmc/utils/RecentlyAddedJob.h b/xbmc/utils/RecentlyAddedJob.h index 0546857430ea7..a77f095366217 100644 --- a/xbmc/utils/RecentlyAddedJob.h +++ b/xbmc/utils/RecentlyAddedJob.h @@ -20,6 +20,7 @@ * */ +#include "ThumbLoader.h" #include "Job.h" enum ERecentlyAddedFlag @@ -37,6 +38,8 @@ class CRecentlyAddedJob : public CJob bool UpdateMusic(); bool UpdateTotal(); virtual bool DoWork(); +protected: + CVideoThumbLoader m_thumbLoader; private: int m_flag; };