From bcc581c10a730095862be1d7cd86af7bd44c6ef2 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 27 Jul 2016 13:02:21 +0800 Subject: [PATCH] Revert to using TheTVDB API v1 for FileBot 4.7.1 release (v2 is not mature enough yet) --- source/net/filebot/WebServices.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/net/filebot/WebServices.java b/source/net/filebot/WebServices.java index f18c396e..43b40091 100644 --- a/source/net/filebot/WebServices.java +++ b/source/net/filebot/WebServices.java @@ -8,9 +8,9 @@ import static net.filebot.Settings.*; import static net.filebot.media.MediaDetection.*; import static net.filebot.util.FileUtilities.*; -import java.util.Collection; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; @@ -36,7 +36,7 @@ import net.filebot.web.SubtitleSearchResult; import net.filebot.web.TMDbClient; import net.filebot.web.TMDbTVClient; import net.filebot.web.TVMazeClient; -import net.filebot.web.TheTVDBClient; +import net.filebot.web.TheTVDBClientV1; import net.filebot.web.VideoHashSubtitleService; import one.util.streamex.StreamEx; @@ -108,7 +108,7 @@ public final class WebServices { public static final ExecutorService requestThreadPool = Executors.newCachedThreadPool(); - public static class TheTVDBClientWithLocalSearch extends TheTVDBClient { + public static class TheTVDBClientWithLocalSearch extends TheTVDBClientV1 { public TheTVDBClientWithLocalSearch(String apikey) { super(apikey); @@ -133,9 +133,9 @@ public final class WebServices { Future> localSearch = requestThreadPool.submit(() -> localIndex.get().search(query)); // combine alias names into a single search results, and keep API search name as primary name - Collection result = StreamEx.of(apiSearch.get()).append(localSearch.get()).groupingBy(SearchResult::getId, collectingAndThen(toList(), group -> merge(group.get(0), group))).values(); + Map results = StreamEx.of(apiSearch.get()).append(localSearch.get()).groupingBy(SearchResult::getId, collectingAndThen(toList(), group -> merge(group.get(0), group))); - return sortBySimilarity(result, singleton(query), getSeriesMatchMetric()); + return sortBySimilarity(results.values(), singleton(query), getSeriesMatchMetric()); } }