Force kodi update of album coverart after updating embedded coverart
#6
Looks like the first point of interest is

master/xbmc/music/infoscanner/MusicInfoScanner.cppSad960-966)

Code:
{ // more than one piece of art was found for these songs, so cache per song
    for (VECSONGS::iterator k = album.songs.begin(); k != album.songs.end(); ++k)
    {
        if (k->strThumb.empty() && !k->embeddedArt.empty())
            k->strThumb = CTextureUtils::GetWrappedImageURL(k->strFileName, "music");
    }
}

I'm not sure yet where/how k->strThumb is set, but if it is set from a currently cached image noted in the database, then embedded coverart will *never* be updated on a library rescan. I think it makes sense that when the pathhash for the folder has changed, to go ahead and update the coverart *IF* the coverart was originally derived from ((embedded art or local art) and (not from online art)). I'll keep digging into this.

The second point of interest is

master/xbmc/music/Song.cppSad290-295)
Code:
bool CSong::HasArt() const
{
  if (!strThumb.empty()) return true;
  if (!embeddedArt.empty()) return true;
  return false;
}

Again, if strThumb isn't empty, it will never check if it has embedded coverart.

strThumb is set at master/xbmc/music/Song.cppSad157)
Code:
strThumb = item.GetUserMusicThumb(true);

The next point of interest is

master/xbmc/FileItem.cppSad2901-2944)
Code:
std::string CFileItem::GetUserMusicThumb(bool alwaysCheckRemote /* = false */, bool fallbackToFolder /* = false */) const
{

    <snip>
   return ""
}

That checks for <filename>.tbn or <foldername>.tbn, then for folder.jpg, returning the first it finds, or an empty string if none are found.

That means that in my use case (embedded art, with no folder.jpg, <filename>.tbn or <foldername>.tbn) that empty() is always satisfied, so my embedded art should be used. So that part of the code seems to be correct, and not part of the problem here.

That's it for my code review for the night; time to watch some TV before work. But I think the next step is tracing what happens after it has the correct art in master/xbmc/music/infoscanner/MusicInfoScanner.cppSad960-966).
Reply


Messages In This Thread
RE: Force kodi update of album coverart after updating embedded coverart - by marktaff - 2017-04-08, 06:08
Logout Mark Read Team Forum Stats Members Help
Force kodi update of album coverart after updating embedded coverart0