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:
parent
e7d67b3ed7
commit
c506a22999
@ -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 {
|
||||
|
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user