1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Properly load albums from database when getting official releases.

This commit is contained in:
Christian Muehlhaeuser 2011-10-19 02:33:08 +02:00
parent 8532189b54
commit 95ce975d40
4 changed files with 5 additions and 6 deletions

View File

@ -35,7 +35,7 @@ album_ptr
Album::get( const Tomahawk::artist_ptr& artist, const QString& name, bool autoCreate )
{
int albid = Database::instance()->impl()->albumId( artist->id(), name, autoCreate );
if ( albid < 1 )
if ( albid < 1 && autoCreate )
return album_ptr();
return Album::get( albid, name, artist );

View File

@ -43,7 +43,7 @@ artist_ptr
Artist::get( const QString& name, bool autoCreate )
{
int artid = Database::instance()->impl()->artistId( name, autoCreate );
if ( artid < 1 )
if ( artid < 1 && autoCreate )
return artist_ptr();
return Artist::get( artid, name );

View File

@ -337,7 +337,7 @@ DatabaseImpl::trackId( int artistid, const QString& name_orig, bool& isnew )
query.addBindValue( sortname );
if( !query.exec() )
{
tDebug() << "Failed to insert track:" << name_orig ;
tDebug() << "Failed to insert track:" << name_orig;
return 0;
}
@ -388,7 +388,7 @@ DatabaseImpl::albumId( int artistid, const QString& name_orig, bool& isnew )
query.addBindValue( sortname );
if( !query.exec() )
{
tDebug() << "Failed to insert album: " << name_orig ;
tDebug() << "Failed to insert album:" << name_orig;
return 0;
}

View File

@ -835,8 +835,7 @@ TreeModel::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestData, QV
foreach ( const QString& albumName, albums )
{
int albumId = 0;
Tomahawk::album_ptr album = Tomahawk::Album::get( albumId, albumName, artist );
Tomahawk::album_ptr album = Tomahawk::Album::get( artist, albumName, false );
al << album;
}
onAlbumsAdded( al, requestData.customData[ "row" ] );