Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1753 from koying/fixmissinggenthumb

FIX: regenerate auto-thumb if not present
  • Loading branch information...
commit e035ef79b202cef7c1a29eba82c428db66b15f49 2 parents 0562c11 + 79178e5
@jmarshallnz jmarshallnz authored
Showing with 28 additions and 20 deletions.
  1. +28 −20 xbmc/video/VideoThumbLoader.cpp
View
48 xbmc/video/VideoThumbLoader.cpp
@@ -250,30 +250,38 @@ bool CVideoThumbLoader::LoadItem(CFileItem* pItem)
}
// thumbnails are special-cased due to auto-generation
- if (!pItem->HasArt("thumb") && !pItem->m_bIsFolder && pItem->IsVideo())
+ if (!pItem->m_bIsFolder && pItem->IsVideo())
{
- // create unique thumb for auto generated thumbs
- CStdString thumbURL = GetEmbeddedThumbURL(*pItem);
- if (CTextureCache::Get().HasCachedImage(thumbURL))
- {
- CTextureCache::Get().BackgroundCacheImage(thumbURL);
- pItem->SetProperty("HasAutoThumb", true);
- pItem->SetProperty("AutoThumbImage", thumbURL);
- pItem->SetArt("thumb", thumbURL);
- }
- else if (g_guiSettings.GetBool("myvideos.extractthumb") &&
- g_guiSettings.GetBool("myvideos.extractflags"))
+ // An auto-generated thumb may have been cached on a different device - check we have it here
+ CStdString url = pItem->GetArt("thumb");
+ if (url.compare(0, 14, "image://video@") == 0 && !CTextureCache::Get().HasCachedImage(url))
+ pItem->SetArt("thumb", "");
+
+ if (!pItem->HasArt("thumb"))
{
- CFileItem item(*pItem);
- CStdString path(item.GetPath());
- if (URIUtils::IsInRAR(item.GetPath()))
- SetupRarOptions(item,path);
+ // create unique thumb for auto generated thumbs
+ CStdString thumbURL = GetEmbeddedThumbURL(*pItem);
+ if (CTextureCache::Get().HasCachedImage(thumbURL))
+ {
+ CTextureCache::Get().BackgroundCacheImage(thumbURL);
+ pItem->SetProperty("HasAutoThumb", true);
+ pItem->SetProperty("AutoThumbImage", thumbURL);
+ pItem->SetArt("thumb", thumbURL);
+ }
+ else if (g_guiSettings.GetBool("myvideos.extractthumb") &&
+ g_guiSettings.GetBool("myvideos.extractflags"))
+ {
+ CFileItem item(*pItem);
+ CStdString path(item.GetPath());
+ if (URIUtils::IsInRAR(item.GetPath()))
+ SetupRarOptions(item,path);
- CThumbExtractor* extract = new CThumbExtractor(item, path, true, thumbURL);
- AddJob(extract);
+ CThumbExtractor* extract = new CThumbExtractor(item, path, true, thumbURL);
+ AddJob(extract);
- m_database->Close();
- return true;
+ m_database->Close();
+ return true;
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.