mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 15:59:42 +01:00
Add some debug and fix a double-delete issue
This commit is contained in:
parent
c62c4fa1d9
commit
0277d1213e
@ -108,6 +108,7 @@ DatabaseCommand_DeleteFiles::exec( DatabaseImpl* dbi )
|
||||
dirquery.bindValue( 0, idstring );
|
||||
tDebug() << Q_FUNC_INFO << " binding id string: " << idstring;
|
||||
dirquery.exec();
|
||||
tDebug() << Q_FUNC_INFO << " result size: " << dirquery.size();
|
||||
while ( dirquery.next() )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << " found dirquery value 0: " << dirquery.value( 0 ).toString() << " and value 1: " << dirquery.value( 1 ).toString();
|
||||
|
@ -257,9 +257,8 @@ MusicScanner::listerFinished( const QMap<QString, unsigned int>& newmtimes )
|
||||
|
||||
// any remaining stuff that wasnt emitted as a batch:
|
||||
foreach( const QString& key, m_filemtimes.keys() )
|
||||
{
|
||||
m_filesToDelete << m_filemtimes[ key ].keys().first();
|
||||
}
|
||||
|
||||
commitBatch( m_scannedfiles, m_filesToDelete );
|
||||
m_scannedfiles.clear();
|
||||
m_filesToDelete.clear();
|
||||
@ -325,6 +324,7 @@ MusicScanner::commitBatch( const QVariantList& tracks, const QVariantList& delet
|
||||
void
|
||||
MusicScanner::scanFile( const QFileInfo& fi )
|
||||
{
|
||||
tDebug() << Q_FUNC_INFO << " scanning file: " << fi.canonicalFilePath();
|
||||
if ( m_mode == TomahawkSettings::Files && m_filemtimes.contains( "file://" + fi.canonicalFilePath() ) )
|
||||
{
|
||||
if ( fi.lastModified().toUTC().toTime_t() == m_filemtimes.value( "file://" + fi.canonicalFilePath() ).values().first() )
|
||||
@ -334,6 +334,7 @@ MusicScanner::scanFile( const QFileInfo& fi )
|
||||
}
|
||||
|
||||
m_filesToDelete << m_filemtimes.value( "file://" + fi.canonicalFilePath() ).keys().first();
|
||||
m_filemtimes.remove( "file://" + fi.canonicalFilePath() );
|
||||
}
|
||||
|
||||
QVariant m = readFile( fi );
|
||||
|
Loading…
x
Reference in New Issue
Block a user