Experimental support for episode level extended info (only supported with TheTVDB data)

This commit is contained in:
Reinhard Pointner 2016-10-31 07:58:27 +08:00
parent 256b5be2d3
commit c7f5fe9364
2 changed files with 12 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package net.filebot.format;
import static java.util.Arrays.*;
import static java.util.regex.Pattern.*;
import static java.util.stream.Collectors.*;
import static net.filebot.MediaTypes.*;
import static net.filebot.WebServices.*;
import static net.filebot.format.ExpressionFormatFunctions.*;
@ -36,6 +37,8 @@ import net.filebot.similarity.Normalization;
import net.filebot.util.FileUtilities;
import net.filebot.web.Episode;
import net.filebot.web.EpisodeInfo;
import net.filebot.web.Person;
import net.filebot.web.SeriesInfo;
import net.filebot.web.SimpleDate;
public class ExpressionFormatMethods {
@ -511,4 +514,11 @@ public class ExpressionFormatMethods {
return null;
}
public static List<String> getActors(SeriesInfo self) throws Exception {
if (TheTVDB.getIdentifier().equals(self.getDatabase()))
return TheTVDBv2.getActors(self.getId(), Locale.ENGLISH).stream().map(Person::getName).collect(toList());
return null;
}
}

View File

@ -62,7 +62,6 @@ import net.filebot.web.EpisodeFormat;
import net.filebot.web.Movie;
import net.filebot.web.MoviePart;
import net.filebot.web.MultiEpisode;
import net.filebot.web.Person;
import net.filebot.web.SeriesInfo;
import net.filebot.web.SimpleDate;
import net.filebot.web.SortOrder;
@ -580,7 +579,7 @@ public class MediaBindingBean {
if (infoObject instanceof Movie)
return getMovieInfo().getActors();
if (infoObject instanceof Episode)
return TheTVDBv2.getActors(getSeriesInfo().getId(), Locale.ENGLISH).stream().map(Person::getName).collect(toList()); // use TheTVDB API v2 to retrieve actors info
return ExpressionFormatMethods.getActors(getSeriesInfo()); // use TheTVDB API v2 to retrieve actors info
return null;
}
@ -605,7 +604,7 @@ public class MediaBindingBean {
if (infoObject instanceof Movie)
return getMovieInfo().getDirector();
if (infoObject instanceof Episode)
return getInfo(getEpisode()).getDirectors().iterator().next();
return ExpressionFormatMethods.getInfo(getEpisode()).getDirectors().iterator().next(); // use TheTVDB API v2 to retrieve extended episode info
return null;
}