From 508c9a7d93249e49f71578e2265dbab905254f27 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 25 May 2009 20:30:32 +0000 Subject: [PATCH] * fixed leading "recap" in episodes titles of recap episodes --- source/net/sourceforge/filebot/web/AnidbClient.java | 6 +++--- test/net/sourceforge/filebot/web/AnidbClientTest.java | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/net/sourceforge/filebot/web/AnidbClient.java b/source/net/sourceforge/filebot/web/AnidbClient.java index e0623e52..34ca64a5 100644 --- a/source/net/sourceforge/filebot/web/AnidbClient.java +++ b/source/net/sourceforge/filebot/web/AnidbClient.java @@ -131,13 +131,13 @@ public class AnidbClient implements EpisodeListProvider { List nodes = selectNodes("id('eplist')//TR/TD/SPAN/ancestor::TR", dom); - ArrayList episodes = new ArrayList(nodes.size()); + List episodes = new ArrayList(nodes.size()); for (Node node : nodes) { List columns = getChildren("TD", node); - String number = columns.get(0).getTextContent().trim(); - String title = columns.get(1).getTextContent().trim(); + String number = getTextContent("A", columns.get(0)); + String title = getTextContent("LABEL", columns.get(1)); // if number does not match, episode is probably some kind of special (S1, S2, ...) if (number.matches("\\d+")) { diff --git a/test/net/sourceforge/filebot/web/AnidbClientTest.java b/test/net/sourceforge/filebot/web/AnidbClientTest.java index ef08d6c3..5664cc3e 100644 --- a/test/net/sourceforge/filebot/web/AnidbClientTest.java +++ b/test/net/sourceforge/filebot/web/AnidbClientTest.java @@ -117,6 +117,12 @@ public class AnidbClientTest { } + @Test + public void getEpisodeListTrimRecap() throws Exception { + assertEquals("Sea God of the East, Azure Sea of the West - Transition Chapter", anidb.getEpisodeList(twelvekingdomsSearchResult).get(44).getTitle()); + } + + @Test public void selectTitle() throws Exception { // use official english title