Bug 318686

Summary: Startup synchronization should wait till all collections have been loaded
Product: [Applications] amarok Reporter: Karthik Periagaram <karthik.periagaram>
Component: Tools/Statistics SynchronizationAssignee: Amarok Developers <amarok-bugs-dist>
Status: CONFIRMED ---    
Severity: normal CC: matej
Priority: NOR    
Version: 2.8.0   
Target Milestone: later   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Bug Depends on: 336380    
Bug Blocks:    

Description Karthik Periagaram 2013-04-21 20:30:48 UTC
When amarok is started, it begins synchronizing statistics even if the other collections have not been fully read into amarok. This is noticeable with a library of about 8000 songs when I have both the local collection and the nepomuk collection enabled. The synchronization begins even though the nepomuk collection hasn't been fully loaded.

Reproducible: Always

Steps to Reproduce:
1. Enable nepomuk collection, statistics synchronization.
2. Restart amarok.
Actual Results:  
Synchronization starts and finishes before the nepomuk collection has been read into amarok.

Expected Results:  
The synchronization should not start until all the collections have been fully read into amarok.
Comment 1 Matěj Laitl 2013-04-22 12:52:11 UTC
I acknowledge this problem.

The StatSyncing framework currently has some heuristics to wait for collections to settle down. (if a collection emits updated() signal at least once in 5s, it is considered still loading) However that heuristics don't work for current NepomukCollection, which does the import in batch (and perhaps neither for the Local Collection on the very first run).

A proper solution would be to introduce better state (loading, idle ...) tracking for collections, on the other hand the NepomukCollection is going to be refactored in a way that it shows all tracks right from the beginning (and fetches the needed metadata on demand).