NowPlayingPlugin: Improved handling of cached album art and fixed that some tracks don't display metadata with Winamp.

This commit is contained in:
Birunthan Mohanathas
2011-05-22 11:05:23 +00:00
parent ef97fb2435
commit 3ba7d39bc4
8 changed files with 91 additions and 98 deletions

View File

@ -371,15 +371,9 @@ void CPlayerITunes::OnTrackChange()
if (m_HasCoverMeasure)
{
// Check if MP3 file contains embedded art
std::wstring cover = CreateCoverArtPath();
if (_waccess(cover.c_str(), 0) == 0)
{
// Cover is in cache, lets use the that
m_CoverPath = cover;
}
else
if (!GetCachedArt())
{
// Art not in cache, check for embedded art
IITArtworkCollection* artworkCollection;
hr = track->get_Artwork(&artworkCollection);
@ -395,9 +389,12 @@ void CPlayerITunes::OnTrackChange()
if (SUCCEEDED(hr))
{
tmpStr = cover.c_str();
tmpStr = m_CoverPath.c_str();
hr = artwork->SaveArtworkToFile(tmpStr);
SUCCEEDED(hr) ? m_CoverPath = cover : m_CoverPath.clear();
if (FAILED(hr))
{
m_CoverPath.clear();
}
artwork->Release();
}
@ -409,6 +406,10 @@ void CPlayerITunes::OnTrackChange()
artworkCollection->Release();
}
else
{
m_CoverPath.clear();
}
}
}
}