1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

* rely less on error-prone webservices

This commit is contained in:
Reinhard Pointner 2013-04-07 05:57:01 +00:00
parent e7d67b3ed7
commit c506a22999
2 changed files with 11 additions and 1 deletions

View File

@ -156,6 +156,16 @@ public final class WebServices {
}
public SeriesInfo getSeriesInfoByLocalIndex(String name, Locale locale) throws Exception {
for (SearchResult it : getLocalIndex().search(name)) {
if (name.equals(it.getName())) {
return getSeriesInfo((TheTVDBSearchResult) it, locale);
}
}
return null;
}
@SuppressWarnings("unchecked")
@Override
public List<SearchResult> fetchSearchResult(final String query, final Locale locale) throws Exception {

View File

@ -469,7 +469,7 @@ public enum EpisodeMetrics implements SimilarityMetric {
public float getRating(Object o) {
if (o instanceof Episode) {
try {
SeriesInfo seriesInfo = WebServices.TheTVDB.getSeriesInfoByName(((Episode) o).getSeriesName(), Locale.ENGLISH);
SeriesInfo seriesInfo = WebServices.TheTVDB.getSeriesInfoByLocalIndex(((Episode) o).getSeriesName(), Locale.ENGLISH);
if (seriesInfo != null && seriesInfo.getRatingCount() >= 10) {
return max(0, seriesInfo.getRating().floatValue());
}