Kodi Community Forum

Full Version: Resolved music scan and fanart Issues related to SMB folder structure
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry for the longevity, but this could impact others and I want to be thorough;

PROBLEM:

Both XBMC Windows and OpenELEC installations since around the EDEN days have exhibited scanning and fanart display issues as follows;

OpenELEC - Directory scan freezes or very slow
XBMC/KODI/OpenELEC - Erroneous fanart URL placed in musicdb ART table resulting in no fanart being displayed.

I've had another thread on this issue here. I think I have it all sorted and thought best to start a new one. Debug logs don't help on this one, so I'm not posting one here.The cause of the problem is the following folder structure;

smb://MEDIASERVER/Music-FLAC/ARTIST-ALBUM/Songs.flac

with source added as;

smb://MEDIASERVER/Music-FLAC/

KODI does not like to scan and scrape this nicely, it seems to want to look into the mother directory, smb://MEDIASERVER/, probably for artist.nfo, but can't since the there is no shared folder with that name. When this happens, regardless of scraper set to "local only" or universal scrapers, KODI will place a server level URL in the musicdb ART table, even when the correct fanart URLs were scraped into the ARTIST info table. On windows, the URL for me was smb://DESKTOP-PC, on OpenELEC, the url was smb://MEDIASERVER. This URL will be placed in the FANART record for every artist in the DB. Then, when displaying artist view, no fanart will display.

On OpenELEC, it also causes scan slowing and freezing issues.

RESOLUTION:

Moving my source folders to within a shared parent folder solved this problem on both OpenELEC and KODI;

smb://MEDIASERVER/MUSIC/Music-FLAC/ARTIST-ALBUM/Songs.flac

So, adding smb://MEDIASERVER/MUSIC/Music-FLAC as a source with the MUSIC folder as a shared parent allows KODI to do its thing. Everthing scans in nicely, artist fanart displays, no odd URLS in the art folder, no freezing on OpenELEC. (Note: Using IP address instead of server name does not change the behavior).

This might be considered a bug, or at least an undesirable result of deviating from the recommended folder structure, but it doesn't seem to me KODI should care, and back around EDEN days, this was not a problem.

Also, it may be helpful to add a Wiki comment or warning to help others avoid my hair pulling and goose chasing. You want to have a shared parent folder two steps above album level.
I still think there is some problem, as I think the scanner should only look into MEDIASERVER/Music-FLAC/ and not higher in your original setup. My guess is something is going wrong in URIUtils::GetParentPath called from here in CMusicInfoScanner:

Code:
// 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, MediaTypeArtist, GetArtistArtwork(artist));
}
}

scott s.
.
Interesting, that looks like you are on to something, or at least circling the target. Its odd that it would update the ART table URL even if it doesn't find any. Somehow that parent path is getting passed along.

It should never try to look above the added source directory level, but it seems to try.