Commit 8e4ad45f authored by Richard Lärkäng's avatar Richard Lärkäng
Browse files

Load all albums, and get correct album artist

svn path=/trunk/KDE/kdemultimedia/libkcddb/; revision=500911
parent f0eb0e50
...@@ -65,34 +65,38 @@ namespace KCDDB ...@@ -65,34 +65,38 @@ namespace KCDDB
return UnknownError; return UnknownError;
} }
if (mb.DataInt(MBE_GetNumAlbums) < 1) int nrAlbums = mb.DataInt(MBE_GetNumAlbums);
if (nrAlbums < 1)
{ {
kdDebug() << "No CD Found" << endl; kdDebug() << "No CD Found" << endl;
return UnknownError; return UnknownError;
} }
mb.Select(MBS_SelectAlbum, 1); for (int i=1; i <= nrAlbums; i++)
{
mb.Select(MBS_SelectAlbum, i);
CDInfo info; CDInfo info;
info.set(Title, QString::fromUtf8(mb.Data(MBE_AlbumGetAlbumName).c_str())); info.set(Title, QString::fromUtf8(mb.Data(MBE_AlbumGetAlbumName).c_str()));
// FIXME info.set(Artist, QString::fromUtf8(mb.Data(MBE_AlbumGetArtistName).c_str()));
info.set(Artist, QString::fromUtf8(mb.Data(MBE_AlbumGetArtistName, 1).c_str()));
int numTracks = trackOffsetList.count()-1; int numTracks = trackOffsetList.count()-1;
for (int i=1; i <= numTracks; i++) for (int i=1; i <= numTracks; i++)
{ {
TrackInfo& track = info.track(i-1); TrackInfo& track = info.track(i-1);
track.set(Artist, QString::fromUtf8(mb.Data(MBE_AlbumGetArtistName, i).c_str())); track.set(Artist, QString::fromUtf8(mb.Data(MBE_AlbumGetArtistName, i).c_str()));
track.set(Title, QString::fromUtf8(mb.Data(MBE_AlbumGetTrackName, i).c_str())); track.set(Title, QString::fromUtf8(mb.Data(MBE_AlbumGetTrackName, i).c_str()));
}
cdInfoList_ << info;
} }
kdDebug() << "Query succeeded :-)" << endl; kdDebug() << "Query succeeded :-)" << endl;
cdInfoList_ << info;
return Success; return Success;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment