diff --git a/jdk8.patch b/jdk8.patch index 1e73b961..d4751fb5 100644 --- a/jdk8.patch +++ b/jdk8.patch @@ -283,7 +283,7 @@ index 4aec2ab8..eb200e57 100644 } diff --git a/source/net/filebot/ThumbnailServices.java b/source/net/filebot/ThumbnailServices.java -index f7241bd2..fae11e64 100644 +index f7241bd2..9e2b3bd9 100644 --- a/source/net/filebot/ThumbnailServices.java +++ b/source/net/filebot/ThumbnailServices.java @@ -10,10 +10,6 @@ import java.awt.image.BufferedImage; @@ -297,7 +297,7 @@ index f7241bd2..fae11e64 100644 import java.nio.ByteBuffer; import java.util.HashMap; import java.util.List; -@@ -62,9 +58,6 @@ public enum ThumbnailServices implements ThumbnailProvider { +@@ -62,43 +58,15 @@ public enum ThumbnailServices implements ThumbnailProvider { private final Resource> index = Resource.lazy(this::getIndex); @@ -307,18 +307,18 @@ index f7241bd2..fae11e64 100644 public byte[][] getThumbnails(int[] ids, ResolutionVariant variant) throws Exception { Cache cache = getCache(variant); byte[][] response = new byte[ids.length][]; -@@ -72,34 +65,7 @@ public enum ThumbnailServices implements ThumbnailProvider { + synchronized (index) { // check cache - for (int i = 0; i < response.length; i++) { +- for (int i = 0; i < response.length; i++) { - response[i] = (byte[]) cache.get(ids[i]); - } - - // create if necessary - CompletableFuture>[] request = new CompletableFuture[ids.length]; - -- for (int i = 0; i < response.length; i++) { -- if (response[i] == null && index.get().contains(ids[i])) { + for (int i = 0; i < response.length; i++) { + if (response[i] == null && index.get().contains(ids[i])) { - String resource = getThumbnailResource(ids[i], variant); - request[i] = http.get().sendAsync(HttpRequest.newBuilder(URI.create(resource)).build(), BodyHandlers.ofByteArray()); - @@ -338,11 +338,10 @@ index f7241bd2..fae11e64 100644 - } catch (Exception e) { - debug.warning(e::toString); - } -- } -+ response[i] = cache.bytes(ids[i], id -> new URL(getThumbnailResource(id, ResolutionVariant.NORMAL))).expire(Cache.ONE_MONTH).get(); ++ response[i] = cache.bytes(ids[i], id -> new URL(getThumbnailResource(id, ResolutionVariant.NORMAL))).expire(Cache.ONE_MONTH).get(); + } } - return response; diff --git a/source/net/filebot/UserFiles.java b/source/net/filebot/UserFiles.java index bb0f65de..25b687ab 100644 --- a/source/net/filebot/UserFiles.java