Comment 2 for bug 1171235

Revision history for this message
Steven Boswell (ulatekh) wrote :

I only seem to be able to attach one patch per comment, so here's the other half of the fix.

TrackDAO::addTracks() was trying to add each track in the playlist to the database. If most of the tracks are in the database already, this is a big waste of time.

I've rewritten the method so that it uses SQL queries to reduce the amount of work that needs to be done. Now it only tries to add tracks that were not already in the database.

On an imported playlist with ~1900 entries, this reduced the time needed to import from 5 minutes to 2 seconds.