aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornight199uk <night199uk@xbmc.org>2013-11-20 00:42:54 +0800
committerJonathan Marshall <jmarshall@xbmc.org>2013-12-24 13:48:58 +1300
commit32c2b7d46d95322fd249a5394ba1399ebef0ff20 (patch)
tree307d4fbb1a7f4d2aacda262e9e652b5c47507e62
parentbab60efa2d730ba3f448743383aaf294294308bc (diff)
[musicdb] fix artist fanart in infoscanner
-rw-r--r--xbmc/music/infoscanner/MusicInfoScanner.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp
index 9ca57980ed..52eea472d0 100644
--- a/xbmc/music/infoscanner/MusicInfoScanner.cpp
+++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp
@@ -715,6 +715,24 @@ int CMusicInfoScanner::RetrieveMusicInfo(const CStdString& strDirectory, CFileIt
album->strPath = strDirectory;
m_musicDatabase.AddAlbum(*album);
+
+ // Yuk - this is a kludgy way to do what we want to do, but it will work to sort
+ // out artist fanart until we can restructure the artist fanart to work more
+ // like the album fanart. This has to be done after we've added the album so
+ // we have the artist IDs to update, but before we call UpdateDatabaseArtistInfo.
+ if (albums.size() == 1 &&
+ album->artistCredits.size() > 0 &&
+ !StringUtils::EqualsNoCase(album->artistCredits[0].GetArtist(), "various artists") &&
+ !StringUtils::EqualsNoCase(album->artistCredits[0].GetArtist(), "various"))
+ {
+ CArtist artist;
+ if (m_musicDatabase.GetArtist(album->artistCredits[0].GetArtistId(), artist))
+ {
+ artist.strPath = URIUtils::GetParentPath(strDirectory);
+ m_musicDatabase.SetArtForItem(artist.idArtist, "artist", GetArtistArtwork(artist));
+ }
+ }
+
if ((m_flags & SCAN_ONLINE))
{
if (!albumScraper || !artistScraper)