Kodi Community Forum

Full Version: Music video getting album thumb from music database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was looking at code, and it seems like for Music Videos, the design is to get an artist thumb and album thumb from the music database. This works for the artist thumb, but not the album thumb.

The code is in VideoThumbLoader.cpp:

Code:
bool CVideoThumbLoader::FillLibraryArt(CFileItem &item)
{
  CVideoInfoTag &tag = *item.GetVideoInfoTag();
  if (tag.m_iDbId > -1 && !tag.m_type.empty())
  {
    std::map<std::string, std::string> artwork;
    m_videoDatabase->Open();

    if (m_videoDatabase->GetArtForItem(tag.m_iDbId, tag.m_type, artwork))
      SetArt(item, artwork);

    else if (tag.m_type == "actor" && !tag.m_artist.empty())
    { // we retrieve music video art from the music database (no backward compat)
      CMusicDatabase database;
      database.Open();
      int idArtist = database.GetArtistByName(item.GetLabel());
      if (database.GetArtForItem(idArtist, MediaTypeArtist, artwork))
        item.SetArt(artwork);
    }

    else if (tag.m_type == MediaTypeAlbum)
    { // we retrieve music video art from the music database (no backward compat)
      CMusicDatabase database;
      database.Open();
      int idAlbum = database.GetAlbumByName(item.GetLabel(), tag.m_artist);
      if (database.GetArtForItem(idAlbum, MediaTypeAlbum, artwork))
        item.SetArt(artwork);
    }

I was hoping maybe some insight from a music db expert if this function is not properly attempting to get the album thumb?

scott s.
.
(2017-07-20, 04:45)scott967 Wrote: [ -> ]I was hoping maybe some insight from a music db expert....
Well I guess that would be me Smile
Quote:... if this function is not properly attempting to get the album thumb?
Not really got into artwork management, nor music videos, but I wil have a look. I've been lacking time for Kodi over the last few weeks Scott, but will get to this soon