mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-10 06:20:27 -04:00
Fix JDK8 patch
This commit is contained in:
parent
d28df06818
commit
bd9b0415ff
15
jdk8.patch
15
jdk8.patch
@ -283,7 +283,7 @@ index 4aec2ab8..eb200e57 100644
|
|||||||
|
|
||||||
}
|
}
|
||||||
diff --git a/source/net/filebot/ThumbnailServices.java b/source/net/filebot/ThumbnailServices.java
|
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
|
--- a/source/net/filebot/ThumbnailServices.java
|
||||||
+++ b/source/net/filebot/ThumbnailServices.java
|
+++ b/source/net/filebot/ThumbnailServices.java
|
||||||
@@ -10,10 +10,6 @@ import java.awt.image.BufferedImage;
|
@@ -10,10 +10,6 @@ import java.awt.image.BufferedImage;
|
||||||
@ -297,7 +297,7 @@ index f7241bd2..fae11e64 100644
|
|||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
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<Set<Integer>> index = Resource.lazy(this::getIndex);
|
private final Resource<Set<Integer>> index = Resource.lazy(this::getIndex);
|
||||||
|
|
||||||
@ -307,18 +307,18 @@ index f7241bd2..fae11e64 100644
|
|||||||
public byte[][] getThumbnails(int[] ids, ResolutionVariant variant) throws Exception {
|
public byte[][] getThumbnails(int[] ids, ResolutionVariant variant) throws Exception {
|
||||||
Cache cache = getCache(variant);
|
Cache cache = getCache(variant);
|
||||||
byte[][] response = new byte[ids.length][];
|
byte[][] response = new byte[ids.length][];
|
||||||
@@ -72,34 +65,7 @@ public enum ThumbnailServices implements ThumbnailProvider {
|
|
||||||
synchronized (index) {
|
synchronized (index) {
|
||||||
// check cache
|
// 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]);
|
- response[i] = (byte[]) cache.get(ids[i]);
|
||||||
- }
|
- }
|
||||||
-
|
-
|
||||||
- // create if necessary
|
- // create if necessary
|
||||||
- CompletableFuture<HttpResponse<byte[]>>[] request = new CompletableFuture[ids.length];
|
- CompletableFuture<HttpResponse<byte[]>>[] request = new CompletableFuture[ids.length];
|
||||||
-
|
-
|
||||||
- for (int i = 0; i < response.length; i++) {
|
for (int i = 0; i < response.length; i++) {
|
||||||
- if (response[i] == null && index.get().contains(ids[i])) {
|
if (response[i] == null && index.get().contains(ids[i])) {
|
||||||
- String resource = getThumbnailResource(ids[i], variant);
|
- String resource = getThumbnailResource(ids[i], variant);
|
||||||
- request[i] = http.get().sendAsync(HttpRequest.newBuilder(URI.create(resource)).build(), BodyHandlers.ofByteArray());
|
- request[i] = http.get().sendAsync(HttpRequest.newBuilder(URI.create(resource)).build(), BodyHandlers.ofByteArray());
|
||||||
-
|
-
|
||||||
@ -338,11 +338,10 @@ index f7241bd2..fae11e64 100644
|
|||||||
- } catch (Exception e) {
|
- } catch (Exception e) {
|
||||||
- debug.warning(e::toString);
|
- 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
|
diff --git a/source/net/filebot/UserFiles.java b/source/net/filebot/UserFiles.java
|
||||||
index bb0f65de..25b687ab 100644
|
index bb0f65de..25b687ab 100644
|
||||||
--- a/source/net/filebot/UserFiles.java
|
--- a/source/net/filebot/UserFiles.java
|
||||||
|
Loading…
x
Reference in New Issue
Block a user