Bug 423696 - thumbnails KCM + cleanup
Summary: thumbnails KCM + cleanup
Status: CONFIRMED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: Thumbnails and previews (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-30 11:54 UTC by Harald Sitter
Modified: 2024-07-09 19:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2020-06-30 11:54:50 UTC
Implement cleanup of thumbnails.

It's very unlikely that the thumbnail spec will ever tell us what to do with the cache specifically. In the end cache handling will largely depend on what a specific desktop wants to do and the specification part is more about having applications with different desktop backgrounds rely on the same backing data. It is, I expect, why the spec currently only briefly mentions cache cleanup as being difficult to specify outside the fact that removed files should have their thumbs removed every once in a while.

With that in mind this really should just get the very same treatment as the trash spec, which equally doesn't really touch on the specifics of how cleanup should work on a UI level exactly.
Specifically there ought to be a thumbnails kcm (probably integrated in dolphin) that allows the user to define:

- a maximum cache age
- a limit on the size of the cache
- actions to be taken when the cache exceeds the limit

Unlike trashing we cannot have the thumbnailer itself clean the cache as the thumbnailer needs to be fast, a trivial cleanup service that gets forked or kded' every once in a while should do the trick though. I think we have some http cleanup thingy that may serve as inspiration. Or if someone can think of a way to have the thumbnailer::get() be responsive while also iterating the entire cache to look for old stuff that'd be cool as well of course.

Additional options could also be:
- remove thumbnails of local paths as soon as their files get deleted (the spec suggests that, but it's actually fairly difficult as there's various things to consider about fstab/mountedness/fstype(fuse)..)
- separate cache age by local vs. remote uris

Cache age determination likely ought to be based on access time rather than modified time. If a thumbnail is being used there's no sense in deleting it I should think.
Comment 1 Méven Car 2020-06-30 15:20:41 UTC
Btw, we sort of have already a thumbnails KCM in dolphin settings, where we already set the max size of files we can generate previews from.
Comment 2 Unknown 2020-11-02 10:32:10 UTC
I hope this will be implemented.