From 032bfd46503465926c29019a4b62f6d016754f37 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 11 Jun 2019 02:13:02 +0700 Subject: [PATCH] Refactor AnimeList client --- source/net/filebot/web/AnimeLists.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/net/filebot/web/AnimeLists.java b/source/net/filebot/web/AnimeLists.java index 1eb7ab61..050bb713 100644 --- a/source/net/filebot/web/AnimeLists.java +++ b/source/net/filebot/web/AnimeLists.java @@ -213,8 +213,12 @@ public class AnimeLists implements Datasource { } } + public Cache getCache() { + return Cache.getCache(getIdentifier(), CacheType.Monthly); + } + public Model getModel() throws Exception { - return Cache.getCache(getIdentifier(), CacheType.Monthly).bytes("https://github.com/ScudLee/anime-lists/raw/master/anime-list.xml", URL::new).transform(bytes -> { + return getCache().bytes("https://github.com/ScudLee/anime-lists/raw/master/anime-list.xml", URL::new).transform(bytes -> { return unmarshal(bytes, Model.class); }).get(); }