| Summary: | incr. collection scanning out of sync | ||
|---|---|---|---|
| Product: | [Applications] amarok | Reporter: | Roland <rolandg> |
| Component: | general | Assignee: | Amarok Bugs <amarok-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Roland
2006-11-20 23:18:26 UTC
how to reproduce find a directory in your collection, where some mp3 files are located; e.g.: cd Music/t/test> ls -l total 832 drwxr-xr-x 2 roland users 16384 2006-05-20 00:45 ./ drwxr-xr-x 44 roland users 16384 2006-10-20 01:06 ../ -rwxr-xr-x 1 roland users 381346 2006-07-22 02:48 Kappee%2fxxx.mp3* -rwxr-xr-x 1 roland users 381346 2006-07-22 02:48 Verità supposte-05 - Limiti.mp3* create an empty directory mkdir x ls -l total 848 drwxr-xr-x 3 roland users 16384 2006-11-20 23:32 ./ drwxr-xr-x 44 roland users 16384 2006-10-20 01:06 ../ -rwxr-xr-x 1 roland users 381346 2006-07-22 02:48 Kappee%2fxxx.mp3* -rwxr-xr-x 1 roland users 381346 2006-07-22 02:48 Verità supposte-05 - Limiti.mp3* drwxr-xr-x 2 roland users 16384 2006-11-20 23:32 x/ --> the debug output of amarok will show: amarok: [CollectionDB] [ERROR!] Already-scanned file at /media/MEDIAx/Music/t/test/Kappee%2fxxx.mp3 has same UID as new file at ./media/MEDIAx/Music/t/test/Kappee%2fxxx.mp3 amarok: [CollectionDB] [ERROR!] Already-scanned file at /media/MEDIAx/Music/t/test/Verità supposte-05 - Limiti.mp3 has same UID as new file at ./media/MEDIAx/Music/t/test/Verità supposte-05 - Limiti.mp3 SVN commit 610256 by mitchell:
Hacky fix for wonky AFT/DynCol interaction
BUG: 137645
M +12 -4 collectiondb.cpp
--- trunk/extragear/multimedia/amarok/src/collectiondb.cpp #610255:610256
@@ -3052,7 +3052,10 @@
//stat the original URL
QString absPath = mpm->getAbsolutePath( uniqueids[2].toInt(), uniqueids[0] );
//debug() << "At doAFTStuff, stat-ing file " << absPath << endl;
- bool statSuccessful = QFile::exists( absPath );
+ bool statSuccessful = false;
+ bool pathsSame = absPath == bundle->url().path();
+ if( !pathsSame )
+ statSuccessful = QFile::exists( absPath );
if( statSuccessful ) //if true, new one is a copy
warning() << "Already-scanned file at " << absPath << " has same UID as new file at " << bundle->url().path() << endl;
else //it's a move, not a copy, or a copy and then both files were moved...can't detect that
@@ -3066,7 +3069,8 @@
<< currurl
<< currdir
<< currid ) );
- emit fileMoved( absPath, bundle->url().path(), bundle->uniqueId() );
+ if( !pathsSame )
+ emit fileMoved( absPath, bundle->url().path(), bundle->uniqueId() );
}
}
//okay then, url already found in temporary table but different uniqueid
@@ -3112,7 +3116,10 @@
//stat the original URL
QString absPath = mpm->getAbsolutePath( nonTempIDs[2].toInt(), nonTempIDs[0] );
//debug() << "At doAFTStuff part 2, stat-ing file " << absPath << endl;
- bool statSuccessful = QFile::exists( absPath );
+ bool statSuccessful = false;
+ bool pathsSame = absPath == bundle->url().path();
+ if( !pathsSame )
+ statSuccessful = QFile::exists( absPath );
if( statSuccessful ) //if true, new one is a copy
warning() << "Already-scanned file at " << absPath << " has same UID as new file at " << currurl << endl;
else //it's a move, not a copy, or a copy and then both files were moved...can't detect that
@@ -3126,7 +3133,8 @@
, currurl
, currid
, currdir ) );
- emit fileMoved( absPath, bundle->url().path(), bundle->uniqueId() );
+ if( !pathsSame )
+ emit fileMoved( absPath, bundle->url().path(), bundle->uniqueId() );
}
}
else if( nonTempIDs.empty() )
|