Added #1875 Remove no longer accessed items from cache after certain amount of time

This commit is contained in:
Jindra Petřík
2022-11-17 08:49:30 +01:00
parent 77a6b6a019
commit 202e66ea1d
12 changed files with 103 additions and 19 deletions

View File

@@ -99,7 +99,7 @@ public class FolderPreviewPanel extends JPanel {
public FolderPreviewPanel(final MainPanel mainPanel, List<TreeItem> items) {
this.items = items;
cachedPreviews = Cache.getInstance(false, false, "preview");
cachedPreviews = Cache.getInstance(false, false, "preview", true);
addMouseListener(new MouseAdapter() {
@Override

View File

@@ -150,7 +150,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
private final List<SoundTagPlayer> soundPlayers = new ArrayList<>();
private final Cache<DisplayObjectCacheKey, SerializableImage> displayObjectCache = Cache.getInstance(false, false, "displayObject");
private final Cache<DisplayObjectCacheKey, SerializableImage> displayObjectCache = Cache.getInstance(false, false, "displayObject", true);
private final IconPanel iconPanel;

View File

@@ -601,4 +601,8 @@ config.name.animateSubsprites = Animate subsprites in preview
config.description.allowMiterClipLinestyle = Allow subsprite animation on timeline preview.
config.name.autoPlayPreviews = Autoplay previews
config.description.autoPlayPreviews = Automatically play previews.
config.description.autoPlayPreviews = Automatically play previews.
config.name.maxCachedTime = Maximum temporary cache time
config.description.maxCachedTime = Maximum time in milliseconds before item (which was not accessed since) is removed from cache. Set this to 0 to unlimited caching.

View File

@@ -588,4 +588,7 @@ config.name.animateSubsprites = Animovat podsprity v n\u00e1hledu
config.description.allowMiterClipLinestyle = Povolit animace podsprit\u016f v n\u00e1hledu timeliny.
config.name.autoPlayPreviews = Automaticky p\u0159ehr\u00e1vat n\u00e1hledy
config.description.autoPlayPreviews = Automaticky p\u0159ehr\u00e1vat n\u00e1hledy.
config.description.autoPlayPreviews = Automaticky p\u0159ehr\u00e1vat n\u00e1hledy.
config.name.maxCachedTime = Maxim\u00e1ln\u00ed \u010das do\u010dasn\u00e9 cache
config.description.maxCachedTime = Maxim\u00e1ln\u00ed \u010das v milisekund\u00e1ch, kter\u00fd mus\u00ed ub\u011bhnout, aby byla polo\u017eka(kter\u00e1 nebyla mezit\u00edm aktivn\u00ed) odstran\u011bna z cache. Nastavte sem hodnotu 0 pro nekone\u010dn\u00e9 cachov\u00e1n\u00ed.