mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Support albumArtist whereever possible.
This commit is contained in:
@@ -198,7 +198,7 @@ AlbumPlaylistInterface::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData re
|
|||||||
|
|
||||||
foreach ( const QString& trackName, tracks )
|
foreach ( const QString& trackName, tracks )
|
||||||
{
|
{
|
||||||
track_ptr track = Track::get( inputInfo[ "artist" ], trackName, inputInfo[ "album" ], 0, QString(), trackNo++ );
|
track_ptr track = Track::get( inputInfo[ "artist" ], trackName, inputInfo[ "album" ], QString(), 0, QString(), trackNo++ );
|
||||||
query_ptr query = Query::get( track );
|
query_ptr query = Query::get( track );
|
||||||
if ( query )
|
if ( query )
|
||||||
ql << query;
|
ql << query;
|
||||||
|
@@ -158,7 +158,7 @@ ArtistPlaylistInterface::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData r
|
|||||||
|
|
||||||
foreach ( const QString& trackName, tracks )
|
foreach ( const QString& trackName, tracks )
|
||||||
{
|
{
|
||||||
track_ptr track = Track::get( inputInfo[ "artist" ], trackName, inputInfo[ "album" ], 0, QString(), trackNo++ );
|
track_ptr track = Track::get( inputInfo[ "artist" ], trackName, inputInfo[ "album" ], QString(), 0, QString(), trackNo++ );
|
||||||
query_ptr query = Query::get( track );
|
query_ptr query = Query::get( track );
|
||||||
if ( query )
|
if ( query )
|
||||||
ql << query;
|
ql << query;
|
||||||
|
@@ -848,7 +848,7 @@ AudioEngine::play( const QUrl& url )
|
|||||||
if ( !tags.isEmpty() )
|
if ( !tags.isEmpty() )
|
||||||
{
|
{
|
||||||
t = Track::get( tags["artist"].toString(), tags["track"].toString(), tags["album"].toString(),
|
t = Track::get( tags["artist"].toString(), tags["track"].toString(), tags["album"].toString(),
|
||||||
tags["duration"].toInt(), tags["composer"].toString(),
|
tags["albumArtist"].toString(), tags["duration"].toInt(), tags["composer"].toString(),
|
||||||
tags["albumpos"].toUInt(), tags["discnumber"].toUInt() );
|
tags["albumpos"].toUInt(), tags["discnumber"].toUInt() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -78,12 +78,14 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
|
|||||||
QString sql = QString(
|
QString sql = QString(
|
||||||
"SELECT file.id, artist.name, album.name, track.name, composer.name, file.size, " //0
|
"SELECT file.id, artist.name, album.name, track.name, composer.name, file.size, " //0
|
||||||
"file.duration, file.bitrate, file.url, file.source, file.mtime, " //6
|
"file.duration, file.bitrate, file.url, file.source, file.mtime, " //6
|
||||||
"file.mimetype, file_join.discnumber, file_join.albumpos, track.id " //11
|
"file.mimetype, file_join.discnumber, file_join.albumpos, track.id, albumArtist.name " //11
|
||||||
"FROM file, artist, track, file_join "
|
"FROM file, artist, track, file_join "
|
||||||
"LEFT OUTER JOIN album "
|
"LEFT OUTER JOIN album "
|
||||||
"ON file_join.album = album.id "
|
"ON file_join.album = album.id "
|
||||||
"LEFT OUTER JOIN artist AS composer "
|
"LEFT OUTER JOIN artist AS composer "
|
||||||
"ON file_join.composer = composer.id "
|
"ON file_join.composer = composer.id "
|
||||||
|
"LEFT OUTER JOIN artist AS albumArtist "
|
||||||
|
"ON album.artist = albumArtist.id "
|
||||||
"WHERE file.id = file_join.file "
|
"WHERE file.id = file_join.file "
|
||||||
"AND file_join.artist = artist.id "
|
"AND file_join.artist = artist.id "
|
||||||
"AND file_join.track = track.id "
|
"AND file_join.track = track.id "
|
||||||
@@ -106,20 +108,21 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
|
|||||||
|
|
||||||
while( query.next() )
|
while( query.next() )
|
||||||
{
|
{
|
||||||
QString artist = query.value( 1 ).toString();
|
const QString artist = query.value( 1 ).toString();
|
||||||
QString album = query.value( 2 ).toString();
|
const QString album = query.value( 2 ).toString();
|
||||||
QString track = query.value( 3 ).toString();
|
const QString track = query.value( 3 ).toString();
|
||||||
QString composer = query.value( 4 ).toString();
|
const QString composer = query.value( 4 ).toString();
|
||||||
uint size = query.value( 5 ).toUInt();
|
const uint size = query.value( 5 ).toUInt();
|
||||||
uint duration = query.value( 6 ).toUInt();
|
const uint duration = query.value( 6 ).toUInt();
|
||||||
uint bitrate = query.value( 7 ).toUInt();
|
const uint bitrate = query.value( 7 ).toUInt();
|
||||||
QString url = query.value( 8 ).toString();
|
QString url = query.value( 8 ).toString();
|
||||||
uint sourceId = query.value( 9 ).toUInt();
|
const uint sourceId = query.value( 9 ).toUInt();
|
||||||
uint modificationTime = query.value( 10 ).toUInt();
|
const uint modificationTime = query.value( 10 ).toUInt();
|
||||||
QString mimetype = query.value( 11 ).toString();
|
const QString mimetype = query.value( 11 ).toString();
|
||||||
uint discnumber = query.value( 12 ).toUInt();
|
const uint discnumber = query.value( 12 ).toUInt();
|
||||||
uint albumpos = query.value( 13 ).toUInt();
|
const uint albumpos = query.value( 13 ).toUInt();
|
||||||
uint trackId = query.value( 14 ).toUInt();
|
const uint trackId = query.value( 14 ).toUInt();
|
||||||
|
const QString albumArtist = query.value( 15 ).toString();
|
||||||
|
|
||||||
std::unordered_map<uint, Tomahawk::source_ptr>::const_iterator _s = sourceCache.find( sourceId );
|
std::unordered_map<uint, Tomahawk::source_ptr>::const_iterator _s = sourceCache.find( sourceId );
|
||||||
Tomahawk::source_ptr s;
|
Tomahawk::source_ptr s;
|
||||||
@@ -142,7 +145,7 @@ DatabaseCommand_AllTracks::exec( DatabaseImpl* dbi )
|
|||||||
|
|
||||||
Tomahawk::track_ptr t = Tomahawk::Track::get( trackId,
|
Tomahawk::track_ptr t = Tomahawk::Track::get( trackId,
|
||||||
artist, track, album,
|
artist, track, album,
|
||||||
duration, composer,
|
albumArtist, duration, composer,
|
||||||
albumpos, discnumber );
|
albumpos, discnumber );
|
||||||
if ( !t )
|
if ( !t )
|
||||||
continue;
|
continue;
|
||||||
|
@@ -111,10 +111,13 @@ DatabaseCommand_Resolve::resolve( DatabaseImpl* lib )
|
|||||||
"file_join.albumpos, " //17
|
"file_join.albumpos, " //17
|
||||||
"artist.id as artid, " //18
|
"artist.id as artid, " //18
|
||||||
"album.id as albid, " //19
|
"album.id as albid, " //19
|
||||||
"composer.id as cmpid " //20
|
"composer.id as cmpid, " //20
|
||||||
|
"albumArtist.id as albumartistid, " //21
|
||||||
|
"albumArtist.name as albumartistname " //22
|
||||||
"FROM file, file_join, artist, track "
|
"FROM file, file_join, artist, track "
|
||||||
"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 "
|
||||||
|
"LEFT JOIN artist AS albumArtist ON albumArtist.id = album.artist "
|
||||||
"WHERE "
|
"WHERE "
|
||||||
"artist.id = file_join.artist AND "
|
"artist.id = file_join.artist AND "
|
||||||
"track.id = file_join.track AND "
|
"track.id = file_join.track AND "
|
||||||
@@ -145,7 +148,9 @@ DatabaseCommand_Resolve::resolve( DatabaseImpl* lib )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
track_ptr track = Track::get( files_query.value( 9 ).toUInt(), files_query.value( 12 ).toString(), files_query.value( 14 ).toString(), files_query.value( 13 ).toString(), files_query.value( 5 ).toUInt(), files_query.value( 15 ).toString(), files_query.value( 17 ).toUInt(), files_query.value( 11 ).toUInt() );
|
track_ptr track = Track::get( files_query.value( 9 ).toUInt(), files_query.value( 12 ).toString(), files_query.value( 14 ).toString(),
|
||||||
|
files_query.value( 13 ).toString(), files_query.value( 22 ).toString(), files_query.value( 5 ).toUInt(),
|
||||||
|
files_query.value( 15 ).toString(), files_query.value( 17 ).toUInt(), files_query.value( 11 ).toUInt() );
|
||||||
if ( !track )
|
if ( !track )
|
||||||
continue;
|
continue;
|
||||||
track->loadAttributes();
|
track->loadAttributes();
|
||||||
@@ -224,10 +229,13 @@ DatabaseCommand_Resolve::fullTextResolve( DatabaseImpl* lib )
|
|||||||
"file_join.albumpos, " //17
|
"file_join.albumpos, " //17
|
||||||
"artist.id as artid, " //18
|
"artist.id as artid, " //18
|
||||||
"album.id as albid, " //19
|
"album.id as albid, " //19
|
||||||
"composer.id as cmpid " //20
|
"composer.id as cmpid, " //20
|
||||||
|
"albumArtist.id as albumartistid, " //21
|
||||||
|
"albumArtist.name as albumartistname " //22
|
||||||
"FROM file, file_join, artist, track "
|
"FROM file, file_join, artist, track "
|
||||||
"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 "
|
||||||
|
"LEFT JOIN artist AS albumArtist ON albumArtist.id = album.artist "
|
||||||
"WHERE "
|
"WHERE "
|
||||||
"artist.id = file_join.artist AND "
|
"artist.id = file_join.artist AND "
|
||||||
"track.id = file_join.track AND "
|
"track.id = file_join.track AND "
|
||||||
@@ -258,7 +266,9 @@ DatabaseCommand_Resolve::fullTextResolve( DatabaseImpl* lib )
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
track_ptr track = Track::get( files_query.value( 9 ).toUInt(), files_query.value( 12 ).toString(), files_query.value( 14 ).toString(), files_query.value( 13 ).toString(), files_query.value( 5 ).toUInt(), files_query.value( 15 ).toString(), files_query.value( 17 ).toUInt(), files_query.value( 11 ).toUInt() );
|
track_ptr track = Track::get( files_query.value( 9 ).toUInt(), files_query.value( 12 ).toString(), files_query.value( 14 ).toString(),
|
||||||
|
files_query.value( 13 ).toString(), files_query.value( 22 ).toString(), files_query.value( 5 ).toUInt(),
|
||||||
|
files_query.value( 15 ).toString(), files_query.value( 17 ).toUInt(), files_query.value( 11 ).toUInt() );
|
||||||
track->loadAttributes();
|
track->loadAttributes();
|
||||||
|
|
||||||
result = Result::get( url, track );
|
result = Result::get( url, track );
|
||||||
|
@@ -290,11 +290,12 @@ Tomahawk::DatabaseImpl::file( int fid )
|
|||||||
TomahawkSqlQuery query = newquery();
|
TomahawkSqlQuery query = newquery();
|
||||||
query.exec( QString( "SELECT url, mtime, size, md5, mimetype, duration, bitrate, "
|
query.exec( QString( "SELECT url, mtime, size, md5, mimetype, duration, bitrate, "
|
||||||
"file_join.artist, file_join.album, file_join.track, file_join.composer, "
|
"file_join.artist, file_join.album, file_join.track, file_join.composer, "
|
||||||
"(select name from artist where id = file_join.artist) as artname, "
|
"(SELECT name FROM artist WHERE id = file_join.artist) AS artname, "
|
||||||
"(select name from album where id = file_join.album) as albname, "
|
"(SELECT name FROM album WHERE id = file_join.album) AS albname, "
|
||||||
"(select name from track where id = file_join.track) as trkname, "
|
"(SELECT name FROM track WHERE id = file_join.track) AS trkname, "
|
||||||
"(select name from artist where id = file_join.composer) as cmpname, "
|
"(SELECT name FROM artist WHERE id = file_join.composer) AS cmpname, "
|
||||||
"source "
|
"source, "
|
||||||
|
"(SELECT artist.name FROM artist, album WHERE artist.id = album.artist AND album.id = file_join.album) AS albumartname "
|
||||||
"FROM file, file_join "
|
"FROM file, file_join "
|
||||||
"WHERE file.id = file_join.file AND file.id = %1" )
|
"WHERE file.id = file_join.file AND file.id = %1" )
|
||||||
.arg( fid ) );
|
.arg( fid ) );
|
||||||
@@ -308,7 +309,9 @@ Tomahawk::DatabaseImpl::file( int fid )
|
|||||||
if ( !s->isLocal() )
|
if ( !s->isLocal() )
|
||||||
url = QString( "servent://%1\t%2" ).arg( s->nodeId() ).arg( url );
|
url = QString( "servent://%1\t%2" ).arg( s->nodeId() ).arg( url );
|
||||||
|
|
||||||
Tomahawk::track_ptr track = Tomahawk::Track::get( query.value( 9 ).toUInt(), query.value( 11 ).toString(), query.value( 13 ).toString(), query.value( 12 ).toString(), query.value( 5 ).toUInt(), query.value( 14 ).toString(), 0, 0 );
|
Tomahawk::track_ptr track = Tomahawk::Track::get( query.value( 9 ).toUInt(), query.value( 11 ).toString(), query.value( 13 ).toString(),
|
||||||
|
query.value( 12 ).toString(), query.value( 16 ).toString(), query.value( 5 ).toUInt(),
|
||||||
|
query.value( 14 ).toString(), 0, 0 );
|
||||||
if ( !track )
|
if ( !track )
|
||||||
return r;
|
return r;
|
||||||
r = Tomahawk::Result::get( url, track );
|
r = Tomahawk::Result::get( url, track );
|
||||||
@@ -633,6 +636,7 @@ Tomahawk::DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
|
|||||||
Tomahawk::track_ptr track = Tomahawk::Track::get( origquery->queryTrack()->artist(),
|
Tomahawk::track_ptr track = Tomahawk::Track::get( origquery->queryTrack()->artist(),
|
||||||
origquery->queryTrack()->track(),
|
origquery->queryTrack()->track(),
|
||||||
origquery->queryTrack()->album(),
|
origquery->queryTrack()->album(),
|
||||||
|
QString(),
|
||||||
origquery->queryTrack()->duration() );
|
origquery->queryTrack()->duration() );
|
||||||
|
|
||||||
// Return http resulthint directly
|
// Return http resulthint directly
|
||||||
@@ -674,10 +678,13 @@ Tomahawk::DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
|
|||||||
"file_join.discnumber, " //17
|
"file_join.discnumber, " //17
|
||||||
"artist.id as artid, " //18
|
"artist.id as artid, " //18
|
||||||
"album.id as albid, " //19
|
"album.id as albid, " //19
|
||||||
"composer.id as cmpid " //20
|
"composer.id as cmpid, " //20
|
||||||
|
"albumArtist.id as albumartistid, " //21
|
||||||
|
"albumArtist.name as albumartistname " //22
|
||||||
"FROM file, file_join, artist, track "
|
"FROM file, file_join, artist, track "
|
||||||
"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 "
|
||||||
|
"LEFT JOIN artist AS albumArtist on albumArtist.id = album.artist "
|
||||||
"WHERE "
|
"WHERE "
|
||||||
"artist.id = file_join.artist AND "
|
"artist.id = file_join.artist AND "
|
||||||
"track.id = file_join.track AND "
|
"track.id = file_join.track AND "
|
||||||
@@ -703,6 +710,7 @@ Tomahawk::DatabaseImpl::resultFromHint( const Tomahawk::query_ptr& origquery )
|
|||||||
query.value( 11 ).toString(),
|
query.value( 11 ).toString(),
|
||||||
query.value( 13 ).toString(),
|
query.value( 13 ).toString(),
|
||||||
query.value( 12 ).toString(),
|
query.value( 12 ).toString(),
|
||||||
|
query.value( 22 ).toString(),
|
||||||
query.value( 5 ).toInt(),
|
query.value( 5 ).toInt(),
|
||||||
query.value( 14 ).toString(),
|
query.value( 14 ).toString(),
|
||||||
query.value( 16 ).toUInt(),
|
query.value( 16 ).toUInt(),
|
||||||
|
@@ -585,6 +585,7 @@ JSResolver::parseResultVariantList( const QVariantList& reslist )
|
|||||||
Tomahawk::track_ptr track = Tomahawk::Track::get( m.value( "artist" ).toString(),
|
Tomahawk::track_ptr track = Tomahawk::Track::get( m.value( "artist" ).toString(),
|
||||||
m.value( "track" ).toString(),
|
m.value( "track" ).toString(),
|
||||||
m.value( "album" ).toString(),
|
m.value( "album" ).toString(),
|
||||||
|
m.value( "albumartist" ).toString(),
|
||||||
duration,
|
duration,
|
||||||
QString(),
|
QString(),
|
||||||
m.value( "albumpos" ).toUInt(),
|
m.value( "albumpos" ).toUInt(),
|
||||||
|
@@ -290,7 +290,14 @@ ScriptResolver::handleMsg( const QByteArray& msg )
|
|||||||
QVariantMap m = rv.toMap();
|
QVariantMap m = rv.toMap();
|
||||||
tDebug( LOGVERBOSE ) << "Found result:" << m;
|
tDebug( LOGVERBOSE ) << "Found result:" << m;
|
||||||
|
|
||||||
Tomahawk::track_ptr track = Tomahawk::Track::get( m.value( "artist" ).toString(), m.value( "track" ).toString(), m.value( "album" ).toString(), m.value( "duration" ).toUInt(), QString(), m.value( "albumpos" ).toUInt(), m.value( "discnumber" ).toUInt() );
|
Tomahawk::track_ptr track = Tomahawk::Track::get( m.value( "artist" ).toString(),
|
||||||
|
m.value( "track" ).toString(),
|
||||||
|
m.value( "album" ).toString(),
|
||||||
|
m.value( "albumartist" ).toString(),
|
||||||
|
m.value( "duration" ).toUInt(),
|
||||||
|
QString(),
|
||||||
|
m.value( "albumpos" ).toUInt(),
|
||||||
|
m.value( "discnumber" ).toUInt() );
|
||||||
if ( !track )
|
if ( !track )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@@ -178,7 +178,7 @@ JSPFLoader::gotBody()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
track_ptr t = Tomahawk::Track::get( artist, track, album, duration.toInt() / 1000 );
|
track_ptr t = Tomahawk::Track::get( artist, track, album, QString(), duration.toInt() / 1000 );
|
||||||
query_ptr q = Tomahawk::Query::get( t );
|
query_ptr q = Tomahawk::Query::get( t );
|
||||||
if ( !q )
|
if ( !q )
|
||||||
continue;
|
continue;
|
||||||
|
@@ -291,7 +291,7 @@ XSPFLoader::gotBody()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
track_ptr t = Tomahawk::Track::get( artist, track, album, duration.toInt() / 1000 );
|
track_ptr t = Tomahawk::Track::get( artist, track, album, QString(), duration.toInt() / 1000 );
|
||||||
query_ptr q = Tomahawk::Query::get( t );
|
query_ptr q = Tomahawk::Query::get( t );
|
||||||
if ( q.isNull() )
|
if ( q.isNull() )
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user