diff --git a/source/ehcache.xml b/source/ehcache.xml index 3553c5ed..b17d9525 100644 --- a/source/ehcache.xml +++ b/source/ehcache.xml @@ -1,5 +1,4 @@ - @@ -7,7 +6,7 @@ - - - - { @Override protected Cache getCache() { - return CacheManager.getInstance().getCache("web-data-diskcache"); + return CacheManager.getInstance().getCache("web-datasource"); } diff --git a/source/net/sourceforge/filebot/web/CachedResource.java b/source/net/sourceforge/filebot/web/CachedResource.java index e4f08b54..0b97a7a7 100644 --- a/source/net/sourceforge/filebot/web/CachedResource.java +++ b/source/net/sourceforge/filebot/web/CachedResource.java @@ -30,6 +30,11 @@ public abstract class CachedResource { } + public CachedResource(String resource, Class type) { + this(resource, type, Long.MAX_VALUE); + } + + protected Cache getCache() { return CacheManager.getInstance().getCache("web-persistent-datasource"); } diff --git a/source/net/sourceforge/filebot/web/FanartTV.java b/source/net/sourceforge/filebot/web/FanartTV.java index 6a5a25a9..e75b069c 100644 --- a/source/net/sourceforge/filebot/web/FanartTV.java +++ b/source/net/sourceforge/filebot/web/FanartTV.java @@ -60,7 +60,7 @@ public class FanartTV { String resource = getResource(category, id, "xml", type, sort, limit); // cache results - CachedResource data = new CachedResource(resource, FanartDescriptor[].class, 7 * 24 * 60 * 60 * 1000) { + CachedResource data = new CachedResource(resource, FanartDescriptor[].class) { @Override public FanartDescriptor[] process(ByteBuffer data) throws Exception { @@ -86,7 +86,7 @@ public class FanartTV { @Override protected Cache getCache() { - return CacheManager.getInstance().getCache("web-data-diskcache"); + return CacheManager.getInstance().getCache("web-datasource"); } }; diff --git a/source/net/sourceforge/filebot/web/IMDbClient.java b/source/net/sourceforge/filebot/web/IMDbClient.java index b6cbb1bf..faa21e83 100644 --- a/source/net/sourceforge/filebot/web/IMDbClient.java +++ b/source/net/sourceforge/filebot/web/IMDbClient.java @@ -175,7 +175,7 @@ public class IMDbClient implements MovieIdentificationService { public Map getImdbApiData(Integer i, String t, String y, boolean tomatoes) throws IOException { // e.g. http://www.imdbapi.com/?i=tt0379786&r=xml&tomatoes=true String url = String.format("http://www.omdbapi.com/?i=%s&t=%s&y=%s&r=xml&tomatoes=%s", String.format(i == null ? "" : "tt%07d", i), t, y, tomatoes); - CachedResource data = new CachedResource(url, HashMap.class, 7 * 24 * 60 * 60 * 1000) { + CachedResource data = new CachedResource(url, HashMap.class) { @Override public HashMap process(ByteBuffer data) throws Exception { @@ -190,7 +190,7 @@ public class IMDbClient implements MovieIdentificationService { @Override protected Cache getCache() { - return CacheManager.getInstance().getCache("web-data-diskcache"); + return CacheManager.getInstance().getCache("web-datasource"); } }; diff --git a/source/net/sourceforge/filebot/web/TMDbClient.java b/source/net/sourceforge/filebot/web/TMDbClient.java index 65288a37..fe1cf463 100644 --- a/source/net/sourceforge/filebot/web/TMDbClient.java +++ b/source/net/sourceforge/filebot/web/TMDbClient.java @@ -238,7 +238,7 @@ public class TMDbClient implements MovieIdentificationService { URL url = new URL("http", host, "/" + version + "/" + resource + "?" + encodeParameters(data, true)); - CachedResource json = new CachedResource(url.toString(), String.class, 7 * 24 * 60 * 60 * 1000) { + CachedResource json = new CachedResource(url.toString(), String.class) { @Override public String process(ByteBuffer data) throws Exception { @@ -263,7 +263,7 @@ public class TMDbClient implements MovieIdentificationService { @Override protected Cache getCache() { - return CacheManager.getInstance().getCache("web-data-diskcache"); + return CacheManager.getInstance().getCache("web-datasource"); } }; diff --git a/website/scripts/lib/ws.groovy b/website/scripts/lib/ws.groovy index 6912a7de..94a86e49 100644 --- a/website/scripts/lib/ws.groovy +++ b/website/scripts/lib/ws.groovy @@ -11,7 +11,7 @@ class MyEpisodesScraper { def username def password - def cache = Cache.getCache('web-persistent-datasource') + def cache = Cache.getCache('web-datasource') def session = [:] def login = {