Skip to content
Browse files

fixed: Thumbs didn't show in the playlist (fixes #13531, #13529)

  • Loading branch information...
1 parent fbf1f62 commit 0789b3d689947b57743abc022998aa00dee319d4 arnova committed Nov 16, 2012
View
14 xbmc/music/MusicInfoLoader.cpp
@@ -34,6 +34,7 @@
#include "utils/log.h"
#include "Artist.h"
#include "Album.h"
+#include "MusicThumbLoader.h"
using namespace std;
using namespace XFILE;
@@ -43,12 +44,15 @@ using namespace MUSIC_INFO;
CMusicInfoLoader::CMusicInfoLoader() : CBackgroundInfoLoader(1)
{
m_mapFileItems = new CFileItemList;
+
+ m_thumbLoader = new CMusicThumbLoader();
}
CMusicInfoLoader::~CMusicInfoLoader()
{
StopThread();
delete m_mapFileItems;
+ delete m_thumbLoader;
}
void CMusicInfoLoader::OnLoaderStart()
@@ -71,6 +75,9 @@ void CMusicInfoLoader::OnLoaderStart()
m_pProgressCallback->SetProgressMax(m_pVecItems->GetFileCount());
m_musicDatabase.Open();
+
+ if (m_thumbLoader)
+ m_thumbLoader->Initialize();
}
bool CMusicInfoLoader::LoadAdditionalTagInfo(CFileItem* pItem)
@@ -124,6 +131,10 @@ bool CMusicInfoLoader::LoadItem(CFileItem* pItem)
if (pItem->m_bIsFolder || pItem->IsPlayList() || pItem->IsNFO() || pItem->IsInternetStream())
return false;
+ // Get thumb for item
+ if (m_thumbLoader)
+ m_thumbLoader->LoadItem(pItem);
+
if (pItem->HasMusicInfoTag() && pItem->GetMusicInfoTag()->Loaded())
return true;
@@ -228,6 +239,9 @@ void CMusicInfoLoader::OnLoaderFinish()
m_pVecItems->Save();
m_musicDatabase.Close();
+
+ if (m_thumbLoader)
+ m_thumbLoader->Deinitialize();
}
void CMusicInfoLoader::UseCacheOnHD(const CStdString& strFileName)
View
2 xbmc/music/MusicInfoLoader.h
@@ -22,6 +22,7 @@
#include "MusicDatabase.h"
class CFileItemList;
+class CMusicThumbLoader;
namespace MUSIC_INFO
{
@@ -48,5 +49,6 @@ class CMusicInfoLoader : public CBackgroundInfoLoader
CMusicDatabase m_musicDatabase;
unsigned int m_databaseHits;
unsigned int m_tagReads;
+ CMusicThumbLoader *m_thumbLoader;
};
}
View
9 xbmc/music/MusicThumbLoader.cpp
@@ -45,15 +45,20 @@ void CMusicThumbLoader::Initialize()
m_albumArt.clear();
}
+void CMusicThumbLoader::Deinitialize()
+{
+ m_database->Close();
+ m_albumArt.clear();
+}
+
void CMusicThumbLoader::OnLoaderStart()
{
Initialize();
}
void CMusicThumbLoader::OnLoaderFinish()
{
- m_database->Close();
- m_albumArt.clear();
+ Deinitialize();
}
bool CMusicThumbLoader::LoadItem(CFileItem* pItem)
View
4 xbmc/music/MusicThumbLoader.h
@@ -37,6 +37,8 @@ class CMusicThumbLoader : public CThumbLoader
virtual ~CMusicThumbLoader();
virtual void Initialize();
+ virtual void Deinitialize();
+
virtual bool LoadItem(CFileItem* pItem);
/*! \brief helper function to fill the art for a video library item
@@ -54,7 +56,7 @@ class CMusicThumbLoader : public CThumbLoader
static bool FillThumb(CFileItem &item);
static bool GetEmbeddedThumb(const std::string &path, MUSIC_INFO::EmbeddedArt &art);
-
+
protected:
virtual void OnLoaderStart();
virtual void OnLoaderFinish();

0 comments on commit 0789b3d

Please sign in to comment.
Something went wrong with that request. Please try again.