[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bamarok=5D_src/core-impl/collections/db/sql=3A_Again?=
From: Ralf Engels <ralf-engels () gmx ! de>
Date: 2011-01-31 23:21:04
Message-ID: 20110131232104.2F39DA60B4 () git ! kde ! org
[Download RAW message or body]
Git commit 797f2c3ce1477a482f8416bfc1641760fa1e6f86 by Ralf Engels.
Pushed by rengels into branch 'master'.
Again a fix for Phantom tracks
M +1 -1 src/core-impl/collections/db/sql/SqlRegistry.cpp
M +1 -1 src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp
http://commits.kde.org/amarok/797f2c3ce1477a482f8416bfc1641760fa1e6f86
diff --git a/src/core-impl/collections/db/sql/SqlRegistry.cpp \
b/src/core-impl/collections/db/sql/SqlRegistry.cpp index 174a7f7..0b3895d 100644
--- a/src/core-impl/collections/db/sql/SqlRegistry.cpp
+++ b/src/core-impl/collections/db/sql/SqlRegistry.cpp
@@ -316,7 +316,7 @@ SqlRegistry::removeTrack( int urlId, const QString uid )
QString query = QString( "DELETE FROM tracks where url=%1;" ).arg( urlId );
m_collection->sqlStorage()->query( query );
// keep the urls and statistics entry in case a deleted track is restored later.
- query = QString( "UPDATE urls SET directory=NULL WHERE id=%1;").arg( urlId );
+ query = QString( "UPDATE urls SET deviceid=0, rpath="", directory=NULL WHERE \
id=%1;").arg( urlId ); m_collection->sqlStorage()->query( query );
query = QString( "UPDATE statistics SET deleted=1 WHERE url=%1;").arg( urlId );
m_collection->sqlStorage()->query( query );
diff --git a/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp \
b/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp index 8a13de1..9476790 \
100644
--- a/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp
+++ b/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp
@@ -388,7 +388,7 @@ SqlScanResultProcessor::cacheUrlsInit()
int directoryId = res.at(i++).toInt();
QString uid = res.at(i++);
- if( !directoryId )
+ if( !directoryId && !rpath.isEmpty() )
{
warning() << "Found urls entry without directory. A phantom track. \
Removing"<<rpath; removeTrack( id, uid );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic