| Summary: | amarok assigns wrong deviceid | ||
|---|---|---|---|
| Product: | [Applications] amarok | Reporter: | Dominik Karall <dominik.karall> |
| Component: | general | Assignee: | Amarok Bugs <amarok-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Dominik Karall
2006-11-26 16:38:43 UTC
SVN commit 608062 by mkossick:
drop complete tables when clearing tables. Fixes a problem where the statistics rows are not
updated when deviceid/url when the deviceid/url for a song changed. This code was only
necessary for CDs/DVDs anyway.
CCBUG: 137916
M +13 -20 collectiondb.cpp
--- trunk/extragear/multimedia/amarok/src/collectiondb.cpp #608061:608062
@@ -763,29 +763,22 @@
CollectionDB::clearTables( const bool temporary )
{
QString clearCommand = "DELETE FROM";
- //if ( getDbConnectionType() == DbConnection::mysql || getDbConnectionType() == DbConnection::postgresql)
- //{
- // TRUNCATE TABLE is faster than DELETE FROM TABLE, so use it when supported.
- // clearCommand = "TRUNCATE TABLE";
- //}
- IdList list = MountPointManager::instance()->getMountedDeviceIds();
- QString deviceIds = "";
- foreachType( IdList, list )
+ if ( getDbConnectionType() == DbConnection::mysql || getDbConnectionType() == DbConnection::postgresql)
{
- if ( it != list.begin() ) deviceIds += ',';
- deviceIds += QString::number(*it);
+ // TRUNCATE TABLE is faster than DELETE FROM TABLE, so use it when supported.
+ clearCommand = "TRUNCATE TABLE";
}
- query( QString( "%1 tags%2 WHERE deviceid IN (%3);" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ).arg( deviceIds ) );
- //query( QString( "%1 album%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
- //query( QString( "%1 artist%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
- //query( QString( "%1 composer%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
- //query( QString( "%1 genre%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
- //query( QString( "%1 year%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
- query( QString( "%1 images%2 WHERE deviceid IN (%3);" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ).arg( deviceIds ) );
- query( QString( "%1 embed%2 WHERE deviceid IN (%3);" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ).arg( deviceIds ) );
- query( QString( "%1 directories%2 WHERE deviceid IN (%3);" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ).arg( deviceIds ) );
- query( QString( "%1 uniqueid%2 WHERE deviceid IN (%3);" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ).arg( deviceIds ) );
+ query( QString( "%1 tags%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 album%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 artist%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 composer%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 genre%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 year%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 images%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 embed%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 directories%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
+ query( QString( "%1 uniqueid%2;" ).arg( clearCommand ).arg( temporary ? "_temp" : "" ) );
if ( !temporary )
{
query( QString( "%1 related_artists;" ).arg( clearCommand ) );
It looks like your KDE mediamanager is not working correctly. Therefore Amarok uses the deviceid -1. SVN revision 608062 fixes the problem that your statistics are not updated with the new deviceid/url of your songs. mediamanager may be stopped by k3b -- see bug 134153 |