CollectionDB & ATF Handling

Seb Ruiz me at sebruiz.net
Sat Jun 24 13:56:31 UTC 2006


Hi Jeff.
 
>      KConfig* atfconfig = amaroK::config( "Collection" );
>      m_atfEnabled = atfconfig->readBoolEntry( "AdvancedTagFeatures", false
> ); +    if( m_atfEnabled )
> +        connect( this, SIGNAL(fileMoved(const QString&, const QString&,
> const QString&)), +                 this, SLOT(migrateStatistics(const
> QString&, const QString&, const QString&)) );
>
>      connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT(
> disableAutoScoring() ) );
>
> @@ -4120,6 +4123,15 @@
>      ThreadWeaver::instance()->queueJob( new SimilarArtistsInsertionJob(
> this, artist, suggestions ) ); }
>
> +void
> +CollectionDB::migrateStatistics( const QString& oldUrl, const QString&
> newUrl, const QString& /*uniqueid*/ ) +{
> +    query( QString( "DELETE FROM statistics WHERE url = '%1';" )
> +                            .arg( escapeString( newUrl ) ) );
> +    query( QString( "UPDATE statistics SET url = '%1' WHERE url = '%2';" )
> +                            .arg( escapeString( newUrl ) )
> +                            .arg( escapeString( oldUrl ) ) );
> +}

This commit is poor, as we already have a method, CollectionDB::migrateFile( 
const QString &oldURL, const QString &newURL ).

Please use it.

Also, there have been numerous reports that users have lost collection 
statistics, and i can't see any other work on stats tables aside from your 
own.

Since we are _once again_ so close to a release, please create an ATF branch 
to work on.  I have already expressed my thoughts on such touchy work so 
close to a release.

Many thanks!
Seb

 
-- 
http://www.sebruiz.net/



More information about the Amarok mailing list