Comment 4 for bug 870544

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

I've added signals from TrackDAO to broadcast tracks-added and tracks-removed signals but the fact that we have multiple TrackDAOs is problematic. At the same time, I don't want TrackDAO to be a singleton because then we have to make it thread safe, which would only contribute to its complexity.

I'm up in the air about how to fix this well. Right now, I'm leaning towards this: The LibraryScanner should re-broadcast the scanner TrackDAO's tracksAdded(QSet<int>) signal and this signal should be hooked up to the "default" BaseTrackCache's "tracksAdded(QSet<int>)" slot. Using a QueuedConnection will send the set by way of the Qt event loop so threading doesn't have to be taken into account -- and this way the BTC only selectively caches the tracks instead of re-indexing the whole library when the scanner is done.