Skip to content

Commit

Permalink
use the new CVideoInfoTag::m_strShowPath to get rid of db queries whe…
Browse files Browse the repository at this point in the history
…n retrieving tvshow fanart on episode level (fixes #11979)
  • Loading branch information
Montellese committed Sep 21, 2011
1 parent efaa990 commit 90c03ce
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions xbmc/ThumbnailCache.cpp
Expand Up @@ -217,13 +217,19 @@ CStdString CThumbnailCache::GetFanart(const CFileItem &item)
return GetThumb(item.GetVideoInfoTag()->m_strArtist,g_settings.GetMusicFanartFolder());
if (!item.m_bIsFolder && !item.GetVideoInfoTag()->m_strShowTitle.IsEmpty())
{
CVideoDatabase database;
database.Open();
int iShowId = item.GetVideoInfoTag()->m_iIdShow;
if (iShowId <= 0)
iShowId = database.GetTvShowId(item.GetVideoInfoTag()->m_strPath);
CStdString showPath;
database.GetFilePathById(iShowId,showPath,VIDEODB_CONTENT_TVSHOWS);
if (!item.GetVideoInfoTag()->m_strShowPath.IsEmpty())
showPath = item.GetVideoInfoTag()->m_strShowPath;
else
{
CVideoDatabase database;
database.Open();
int iShowId = item.GetVideoInfoTag()->m_iIdShow;
if (iShowId <= 0)
iShowId = database.GetTvShowId(item.GetVideoInfoTag()->m_strPath);
CStdString showPath;
database.GetFilePathById(iShowId,showPath,VIDEODB_CONTENT_TVSHOWS);
}
return GetThumb(showPath,g_settings.GetVideoFanartFolder());
}
return GetThumb(item.m_bIsFolder ? item.GetVideoInfoTag()->m_strPath : item.GetVideoInfoTag()->m_strFileNameAndPath,g_settings.GetVideoFanartFolder());
Expand Down

0 comments on commit 90c03ce

Please sign in to comment.