1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-08 18:12:41 +02:00

Get the discnumber in databaseimpl.cpp as well.

This commit is contained in:
Teo Mrnjavac 2011-12-26 17:41:50 +01:00 committed by Dominik Schmidt
parent b8a38f7eda
commit 93722665af
4 changed files with 15 additions and 11 deletions

View File

@ -154,4 +154,4 @@ Album::playlistInterface()
}
return m_playlistInterface;
}
}

View File

@ -90,6 +90,7 @@ AlbumPlaylistInterface::tracks()
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks();
cmd->setAlbum( m_album );
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );
//this takes discnumber into account as well
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
m_album.data(), SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );

View File

@ -569,10 +569,11 @@ DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
"composer.name as cmpname, " //14
"file.source, " //15
"file_join.albumpos, " //16
"artist.id as artid, " //17
"album.id as albid, " //18
"composer.id as cmpid, " //19
"track_attributes.v as year " //20
"file_join.discnumber, " //17
"artist.id as artid, " //18
"album.id as albid, " //19
"composer.id as cmpid, " //20
"track_attributes.v as year " //21
"FROM file, file_join, artist, track, track_attributes "
"LEFT JOIN album ON album.id = file_join.album "
"LEFT JOIN artist AS composer on composer.id = file_join.composer "
@ -610,9 +611,9 @@ DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
}
res = Tomahawk::Result::get( url );
Tomahawk::artist_ptr artist = Tomahawk::Artist::get( query.value( 17 ).toUInt(), query.value( 11 ).toString() );
Tomahawk::album_ptr album = Tomahawk::Album::get( query.value( 18 ).toUInt(), query.value( 12 ).toString(), artist );
Tomahawk::artist_ptr composer = Tomahawk::Artist::get( query.value( 19 ).toUInt(), query.value( 14 ).toString() );
Tomahawk::artist_ptr artist = Tomahawk::Artist::get( query.value( 18 ).toUInt(), query.value( 11 ).toString() );
Tomahawk::album_ptr album = Tomahawk::Album::get( query.value( 19 ).toUInt(), query.value( 12 ).toString(), artist );
Tomahawk::artist_ptr composer = Tomahawk::Artist::get( query.value( 20 ).toUInt(), query.value( 14 ).toString() );
res->setModificationTime( query.value( 1 ).toUInt() );
res->setSize( query.value( 2 ).toUInt() );
@ -625,10 +626,11 @@ DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
res->setScore( 1.0 );
res->setTrack( query.value( 13 ).toString() );
res->setAlbumPos( query.value( 16 ).toUInt() );
res->setDiscNumber( query.value( 17 ).toUInt() );
res->setRID( uuid() );
res->setTrackId( query.value( 9 ).toUInt() );
res->setCollection( s->collection() );
res->setYear( query.value( 20 ).toUInt() );
res->setYear( query.value( 21 ).toUInt() );
}
return res;

View File

@ -330,8 +330,9 @@ TreeModel::data( const QModelIndex& index, int role ) const
switch( index.column() )
{
case Name:
return QString( "%1%2" ).arg( query->albumpos() > 0 ? QString( "%1. ").arg( query->albumpos() ) : QString() )
.arg( query->track() );
return QString( "%1%2%3" ).arg( query->discnumber() > 0 ? QString( "%1." ).arg( query->discnumber() ) : QString() )
.arg( query->albumpos() > 0 ? QString( "%1. ").arg( query->albumpos() ) : QString() )
.arg( query->track() );
case AlbumPosition:
return entry->query()->albumpos();