Commit 07a385ccdd57629f7588503d8d1bfe500b43f15b
- Diff rendering mode:
- inline
- side by side
src/collectiondb.cpp
(4 / 6)
|   | |||
| 1383 | 1383 | ||
| 1384 | 1384 | ||
| 1385 | 1385 | void | |
| 1386 | CollectionDB::checkCompilations( const QString &path, const bool temporary, DbConnection *conn ) | ||
| 1386 | CollectionDB::checkCompilations( const QString &path, DbConnection *conn ) | ||
| 1387 | 1387 | { | |
| 1388 | 1388 | QStringList albums; | |
| 1389 | 1389 | QStringList artists; | |
| 1390 | 1390 | QStringList dirs; | |
| 1391 | 1391 | ||
| 1392 | albums = query( QString( "SELECT DISTINCT album.name FROM tags_temp, album%1 AS album WHERE tags_temp.dir = '%2' AND album.id = tags_temp.album;" ) | ||
| 1393 | .arg( temporary ? "_temp" : "" ) | ||
| 1392 | albums = query( QString( "SELECT DISTINCT album_temp.name FROM tags_temp, album_temp WHERE tags_temp.dir = '%1' AND album_temp.id = tags_temp.album;" ) | ||
| 1394 | 1393 | .arg( escapeString( path ) ), conn ); | |
| 1395 | 1394 | ||
| 1396 | 1395 | for ( uint i = 0; i < albums.count(); i++ ) | |
| 1397 | 1396 | { | |
| 1398 | 1397 | if ( albums[ i ].isEmpty() ) continue; | |
| 1399 | 1398 | ||
| 1400 | const uint album_id = albumID( albums[ i ], false, temporary ); | ||
| 1401 | artists = query( QString( "SELECT DISTINCT artist.name FROM tags_temp, artist%1 AS artist WHERE tags_temp.album = '%2' AND tags_temp.artist = artist.id;" ) | ||
| 1402 | .arg( temporary ? "_temp" : "" ) | ||
| 1399 | const uint album_id = albumID( albums[ i ], FALSE, TRUE, conn ); | ||
| 1400 | artists = query( QString( "SELECT DISTINCT artist_temp.name FROM tags_temp, artist_temp WHERE tags_temp.album = '%1' AND tags_temp.artist = artist_temp.id;" ) | ||
| 1403 | 1401 | .arg( album_id ), conn ); | |
| 1404 | 1402 | dirs = query( QString( "SELECT DISTINCT dir FROM tags_temp WHERE album = '%1';" ) | |
| 1405 | 1403 | .arg( album_id ), conn ); |
src/collectiondb.h
(1 / 1)
|   | |||
| 155 | 155 | QStringList similarArtists( const QString &artist, uint count ); | |
| 156 | 156 | ||
| 157 | 157 | //album methods | |
| 158 | void checkCompilations( const QString &path, const bool temporary = false, DbConnection *conn = NULL ); | ||
| 158 | void checkCompilations( const QString &path, DbConnection *conn = NULL ); | ||
| 159 | 159 | QString albumSongCount( const QString &artist_id, const QString &album_id ); | |
| 160 | 160 | ||
| 161 | 161 | //list methods |
src/collectionreader.cpp
(1 / 1)
|   | |||
| 248 | 248 | ||
| 249 | 249 | cbl.clear(); | |
| 250 | 250 | images.clear(); | |
| 251 | CollectionDB::instance()->checkCompilations( url.path().section( '/', 0, -2 ), !m_incremental, m_staticDbConnection ); | ||
| 251 | CollectionDB::instance()->checkCompilations( url.path().section( '/', 0, -2 ), m_staticDbConnection ); | ||
| 252 | 252 | } | |
| 253 | 253 | } | |
| 254 | 254 |

