Moodbar caching

Nikhil Marathe nsm.nikhil at gmail.com
Tue Mar 22 12:47:13 CET 2011


Hi,

In ref. to bug https://bugs.kde.org/show_bug.cgi?id=260839 and
MoodbarManager implementation
I think the caching approach needs to be redefined. MoodbarManager
aggressively caches even for the
'existence' of a .mood file. Now Nikolaj's commit message from a long
long time ago :)
https://projects.kde.org/projects/extragear/multimedia/amarok/repository/revisions/bc7d0ce3888b2b367489cd9882b5e16c60b53bfe
says the cache should periodically expire.
Now I can't think of any simple or time based caching strategy that
could satisfy every use case.
I am proposing an alternative strategy of 'cache only if .mood exists'.

 Which means that when a .mood file is NOT FOUND:
     the next time a check is requested (hasMoodbar()), we CHECK IF
THE FILE EXISTS by hitting disk.
 When a .mood file IS FOUND:
     we stick it into the cache saying we do have the moodfile

This way, bugs like 260839 get resolved. Before I start implementing
the change, I just
wanted to know what is the worst case scenario. AFAIK this should not
hit the disk more
than once on track changes, and perhaps 10-15 times on initial startup
if the user has enabled moodbar drawing in the playlist view too.
Should we go ahead and reduce the amount of caching?

Regards,
Nikhil


More information about the Amarok-devel mailing list