changed: Make user file thumbs overrule embedded art in music files
authorarnova <arnova@void.org>
Tue, 20 Nov 2012 11:41:03 +0000 (12:41 +0100)
committerarnova <arnova@void.org>
Tue, 20 Nov 2012 14:09:41 +0000 (15:09 +0100)
xbmc/music/MusicThumbLoader.cpp
xbmc/music/MusicThumbLoader.h

index c7ffdef..8eb741b 100644 (file)
@@ -99,26 +99,32 @@ bool CMusicThumbLoader::LoadItem(CFileItem* pItem)
     // Look for embedded art
     if (pItem->HasMusicInfoTag() && !pItem->GetMusicInfoTag()->GetCoverArtInfo().empty())
     {
-      CStdString thumb = CTextureCache::GetWrappedImageURL(pItem->GetPath(), "music");
-      pItem->SetArt("thumb", thumb);
+      // The item has got embedded art but user thumbs overrule, so check for those first
+      if (!FillThumb(*pItem, false)) // Check for user thumbs but ignore folder thumbs
+      {
+        // No user thumb, use embedded art
+        CStdString thumb = CTextureCache::GetWrappedImageURL(pItem->GetPath(), "music");
+        pItem->SetArt("thumb", thumb);
+      }
     }
     else
     {
-      FillThumb(*pItem);
+      // Check for user thumbs
+      FillThumb(*pItem, true);
     }
   }
 
   return true;
 }
 
-bool CMusicThumbLoader::FillThumb(CFileItem &item)
+bool CMusicThumbLoader::FillThumb(CFileItem &item, bool folderThumbs /* = true */)
 {
   if (item.HasArt("thumb"))
     return true;
   CStdString thumb = GetCachedImage(item, "thumb");
   if (thumb.IsEmpty())
   {
-    thumb = item.GetUserMusicThumb(false, true);
+    thumb = item.GetUserMusicThumb(false, folderThumbs);
     if (!thumb.IsEmpty())
       SetCachedImage(item, "thumb", thumb);
   }
index e3978da..ecf77c6 100644 (file)
@@ -53,7 +53,7 @@ public:
    \param item the CFileItem object to fill
    \return true if we fill the thumb, false otherwise
    */
-  static bool FillThumb(CFileItem &item);
+  static bool FillThumb(CFileItem &item, bool folderThumbs = true);
   
   static bool GetEmbeddedThumb(const std::string &path, MUSIC_INFO::EmbeddedArt &art);