Skip to content

Commit

Permalink
[art] use artist.fanart for artist fanart, and add fallbacks for fana…
Browse files Browse the repository at this point in the history
…rt->artist.fanart and thumb->album.thumb for albums/songs
  • Loading branch information
Jonathan Marshall committed Nov 10, 2012
1 parent 93a2523 commit bd8a472
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions xbmc/music/MusicThumbLoader.cpp
Expand Up @@ -80,7 +80,10 @@ bool CMusicThumbLoader::LoadItem(CFileItem* pItem)
{
string fanart = m_database->GetArtForItem(idArtist, "artist", "fanart");
if (!fanart.empty())
pItem->SetArt("fanart", fanart);
{
pItem->SetArt("artist.fanart", fanart);
pItem->SetArtFallback("fanart", "artist.fanart");
}
}
m_database->Close();
}
Expand Down Expand Up @@ -127,11 +130,18 @@ bool CMusicThumbLoader::FillLibraryArt(CFileItem &item)
if (i != m_albumArt.end())
{
item.AppendArt(i->second, "album");
for (map<string, string>::const_iterator j = i->second.begin(); j != i->second.end(); ++j)
item.SetArtFallback(j->first, "album." + j->first);
}
}
if (tag.GetType() == "song" || tag.GetType() == "album")
{ // fanart from the artist
item.SetArt("fanart", m_database->GetArtistArtForItem(tag.GetDatabaseId(), tag.GetType(), "fanart"));
string fanart = m_database->GetArtistArtForItem(tag.GetDatabaseId(), tag.GetType(), "fanart");
if (!fanart.empty())
{
item.SetArt("artist.fanart", fanart);
item.SetArtFallback("fanart", "artist.fanart");
}
}
m_database->Close();
}
Expand Down

0 comments on commit bd8a472

Please sign in to comment.