mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Get the discnumber in databaseimpl.cpp as well.
This commit is contained in:
committed by
Dominik Schmidt
parent
b8a38f7eda
commit
93722665af
@@ -90,6 +90,7 @@ AlbumPlaylistInterface::tracks()
|
|||||||
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks();
|
DatabaseCommand_AllTracks* cmd = new DatabaseCommand_AllTracks();
|
||||||
cmd->setAlbum( m_album );
|
cmd->setAlbum( m_album );
|
||||||
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );
|
cmd->setSortOrder( DatabaseCommand_AllTracks::AlbumPosition );
|
||||||
|
//this takes discnumber into account as well
|
||||||
|
|
||||||
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
|
connect( cmd, SIGNAL( tracks( QList<Tomahawk::query_ptr>, QVariant ) ),
|
||||||
m_album.data(), SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );
|
m_album.data(), SLOT( onTracksAdded( QList<Tomahawk::query_ptr> ) ) );
|
||||||
|
@@ -569,10 +569,11 @@ DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
|
|||||||
"composer.name as cmpname, " //14
|
"composer.name as cmpname, " //14
|
||||||
"file.source, " //15
|
"file.source, " //15
|
||||||
"file_join.albumpos, " //16
|
"file_join.albumpos, " //16
|
||||||
"artist.id as artid, " //17
|
"file_join.discnumber, " //17
|
||||||
"album.id as albid, " //18
|
"artist.id as artid, " //18
|
||||||
"composer.id as cmpid, " //19
|
"album.id as albid, " //19
|
||||||
"track_attributes.v as year " //20
|
"composer.id as cmpid, " //20
|
||||||
|
"track_attributes.v as year " //21
|
||||||
"FROM file, file_join, artist, track, track_attributes "
|
"FROM file, file_join, artist, track, track_attributes "
|
||||||
"LEFT JOIN album ON album.id = file_join.album "
|
"LEFT JOIN album ON album.id = file_join.album "
|
||||||
"LEFT JOIN artist AS composer on composer.id = file_join.composer "
|
"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 );
|
res = Tomahawk::Result::get( url );
|
||||||
Tomahawk::artist_ptr artist = Tomahawk::Artist::get( query.value( 17 ).toUInt(), query.value( 11 ).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( 18 ).toUInt(), query.value( 12 ).toString(), artist );
|
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( 19 ).toUInt(), query.value( 14 ).toString() );
|
Tomahawk::artist_ptr composer = Tomahawk::Artist::get( query.value( 20 ).toUInt(), query.value( 14 ).toString() );
|
||||||
|
|
||||||
res->setModificationTime( query.value( 1 ).toUInt() );
|
res->setModificationTime( query.value( 1 ).toUInt() );
|
||||||
res->setSize( query.value( 2 ).toUInt() );
|
res->setSize( query.value( 2 ).toUInt() );
|
||||||
@@ -625,10 +626,11 @@ DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
|
|||||||
res->setScore( 1.0 );
|
res->setScore( 1.0 );
|
||||||
res->setTrack( query.value( 13 ).toString() );
|
res->setTrack( query.value( 13 ).toString() );
|
||||||
res->setAlbumPos( query.value( 16 ).toUInt() );
|
res->setAlbumPos( query.value( 16 ).toUInt() );
|
||||||
|
res->setDiscNumber( query.value( 17 ).toUInt() );
|
||||||
res->setRID( uuid() );
|
res->setRID( uuid() );
|
||||||
res->setTrackId( query.value( 9 ).toUInt() );
|
res->setTrackId( query.value( 9 ).toUInt() );
|
||||||
res->setCollection( s->collection() );
|
res->setCollection( s->collection() );
|
||||||
res->setYear( query.value( 20 ).toUInt() );
|
res->setYear( query.value( 21 ).toUInt() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@@ -330,7 +330,8 @@ TreeModel::data( const QModelIndex& index, int role ) const
|
|||||||
switch( index.column() )
|
switch( index.column() )
|
||||||
{
|
{
|
||||||
case Name:
|
case Name:
|
||||||
return QString( "%1%2" ).arg( query->albumpos() > 0 ? QString( "%1. ").arg( query->albumpos() ) : QString() )
|
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() );
|
.arg( query->track() );
|
||||||
|
|
||||||
case AlbumPosition:
|
case AlbumPosition:
|
||||||
|
Reference in New Issue
Block a user