Bug 133269

Summary: dynamic playlist sources unavailable after a collection rescan
Product: [Applications] amarok Reporter: richlv
Component: generalAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description richlv 2006-08-30 12:52:21 UTC
Version:           svn 578726 (using KDE KDE 3.5.4)
Installed from:    Slackware Packages
OS:                Linux

create a dynamic collection that draws songs from a smart playlist (i was using never played).
after a collection rescan (for example, initiated by stat tables version increase), no songs are added to the dynamic playlist, amarok claims that there are no sources defined for the dynamic playlist.
it is enough to edit the dynamic playlist (and verify that sources are actually set correctly) & click cancel - after this, tracks are added properly.
Comment 1 Seb Ruiz 2006-11-13 01:15:27 UTC
SVN commit 604494 by seb:

Refactor of dynamic mode. This revised implementation solves a number of bugs. The logic of adding tracks from a dynamic mode is now delegated to the DynamicMode object, and is not done within the playlist. When a dynamic mode is loaded, a cache of 200 elements is create from the playlist sources. By caching a subset of the possible tracks to be inserted, there is no longer a requirement to execute complex SQL statements on each track change or playlist repopulation. Additionally, by grabbing random tracks from this cache, items are no longer fetched from just one source, but all of them. Once these cached tracks have been inserted into the playlist, they are removed from the cache list in order to avoid duplicating song insertions. Once the cache has been depleted, it is simply regenerated. 200 elements is approximately 12 hours worth of music, so the set should be sufficiently large to handle the user's requirements.

I've done quite a bit of regression testing, but the more the merrier :). The only feature which needs to be fixed is the Suggested mode of dynamic playlists, but this should be easily rectifiable.

BUG: 134159
BUG: 137212
BUG: 107693
BUG: 130542
BUG: 133269
BUG: 113120


 M  +233 -14   dynamicmode.cpp  
 M  +51 -6     dynamicmode.h  
 M  +12 -204   playlist.cpp  
 M  +3 -4      playlist.h  
 M  +1 -1      playlistbrowser.cpp