Misbehaviour/Fail of CMusicDatabase::GetArtistPath()
#1
This is my first post here in the developer forum. So please tell me if it is not the right place or form of my request.

The way how GetArtistPath() is working fails on my Music library currently for one artist. I've a clean library of Artist/Album/Tracks directory structure. If I query the Music library in the same way like GetArtistPath() I get the following result:
Code:
sqlite> select strPath from album_artist join song on album_artist.idAlbum = song.idAlbum join path on song.idPath = path.idPath where album_artist.idArtist = 38 group by song.idPath;
smb://TS3/data/music/lib/Mark Knopfler/Kill To Get Crimson/
smb://TS3/data/music/lib/Dire Straits/Private Investigations (The Best Of)/

Private Investigation is a Dire Straits album where Mark Knopfler features some single songs. As a result GetArtistPath() fails to find a path where to store album.nfo. I assume that GetArtistPath() fails for every artist who features some songs of another artist/album in the library.

I think that GetArtistPath() should exclude such songs where the artist only is featured. So the SQL statement in the source code could be extended as follows:
Code:
CStdString strSQL=PrepareSQL("SELECT strPath"
                                 "  FROM album_artist"
                                 "  JOIN song "
                                 "    ON album_artist.idAlbum = song.idAlbum"
                                 "  JOIN path"
                                 "    ON song.idPath = path.idPath"
                                 " WHERE album_artist.idArtist = %i"
/* --> */                        " AND album_artist.boolFeatured = 0"
                                 " GROUP BY song.idPath", idArtist);

I think it does not make much sense to ask for a developer account for such a small change. So I ask if anybody from you developers could have a look on that issue.

Thanks in advance.
igs
Reply
#2
First off, you don't need to ask for a dev account, you can just fork the code on github and throw a pull request our way. Smile

Secondly, this seems reasonable to me. Are we guaranteed that boolFeatured = 0 for the first artist on an album - I think we are?

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Misbehaviour/Fail of CMusicDatabase::GetArtistPath()0