From 5c705427beed0f5a80b55bae57442132d546ff93 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 28 Dec 2013 04:34:11 +0000 Subject: [PATCH] * make {episodelist} binding reference back to the original datasource --- .../net/sourceforge/filebot/format/MediaBindingBean.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/net/sourceforge/filebot/format/MediaBindingBean.java b/source/net/sourceforge/filebot/format/MediaBindingBean.java index 60cb39d3..62a1dfb0 100644 --- a/source/net/sourceforge/filebot/format/MediaBindingBean.java +++ b/source/net/sourceforge/filebot/format/MediaBindingBean.java @@ -42,7 +42,6 @@ import net.sourceforge.filebot.web.Movie; import net.sourceforge.filebot.web.MoviePart; import net.sourceforge.filebot.web.MultiEpisode; import net.sourceforge.filebot.web.SearchResult; -import net.sourceforge.filebot.web.SortOrder; import net.sourceforge.filebot.web.TheTVDBSearchResult; import net.sourceforge.tuned.FileUtilities; import net.sourceforge.tuned.FileUtilities.ExtensionFileFilter; @@ -519,7 +518,13 @@ public class MediaBindingBean { @Define("episodelist") public Object getEpisodeList() throws Exception { - return WebServices.TheTVDB.getEpisodeList(WebServices.TheTVDB.search(getEpisode().getSeriesName()).get(0), SortOrder.Airdate, Locale.ENGLISH); + if (getSeriesObject() instanceof TheTVDBSearchResult) { + return WebServices.TheTVDB.getEpisodeList(getSeriesObject()); + } + if (getSeriesObject() instanceof AnidbSearchResult) { + return WebServices.AniDB.getEpisodeList(getSeriesObject()); + } + return null; // default to original search result } @Define("duration")