Index: amarok/src/collectiondb.cpp
===================================================================
--- amarok/src/collectiondb.cpp	(revision 779550)
+++ amarok/src/collectiondb.cpp	(working copy)
@@ -3254,13 +3254,16 @@
 }
 
 QString
-CollectionDB::uniqueIdFromUrl( const KURL &url )
+CollectionDB::uniqueIdFromUrl( const KURL &url, bool ignorescanning)
 {
     MountPointManager *mpm = MountPointManager::instance();
     int currdeviceid = mpm->getIdForUrl( url.path() );
     QString currurl = escapeString( mpm->getRelativePath( currdeviceid, url.path() ) );
 
-    bool scanning = ( ScanController::instance() && ScanController::instance()->tablesCreated() );
+    bool scanning = false;
+    if (!ignorescanning)
+        scanning = ( ScanController::instance() && ScanController::instance()->tablesCreated() );
+
     QStringList uid = query( QString(
             "SELECT uniqueid "
             "FROM uniqueid%1 "
Index: amarok/src/collectiondb.h
===================================================================
--- amarok/src/collectiondb.h	(revision 779550)
+++ amarok/src/collectiondb.h	(working copy)
@@ -335,7 +335,7 @@
         bool newUniqueIdForFile( const QString &path );
         bool removeUniqueIdFromFile( const QString &path );
         QString urlFromUniqueId( const QString &id );
-        QString uniqueIdFromUrl( const KURL &url );
+        QString uniqueIdFromUrl( const KURL &url, bool ignorescanning=false );
 
         //podcast methods
         /// Insert a podcast channel into the database.  If @param replace is true, replace the row
Index: amarok/src/metabundle.cpp
===================================================================
--- amarok/src/metabundle.cpp	(revision 779550)
+++ amarok/src/metabundle.cpp	(working copy)
@@ -1602,7 +1602,7 @@
     if( !isFile() )
         return;
 
-    m_uniqueId = CollectionDB::instance()->uniqueIdFromUrl( url() );
+    m_uniqueId = CollectionDB::instance()->uniqueIdFromUrl( url(), true );
 }
 
 void MetaBundle::setUniqueId( const QString &id )
