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

Fix regression issue.

https://www.filebot.net/forums/viewtopic.php?f=6&t=4023
This commit is contained in:
Reinhard Pointner 2016-08-03 01:51:53 +08:00
parent 4f4f90ecdc
commit d3df8cd4e4
3 changed files with 6 additions and 8 deletions

View File

@ -32,7 +32,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
@ -384,8 +383,8 @@ public class CmdlineOperations implements CmdlineInterface {
}
}
}
} catch (NoSuchElementException e) {
log.warning("Failed to grep IMDbID: " + nfo.getName());
} catch (Exception e) {
log.log(Level.WARNING, "Failed to grep IMDbID: " + nfo.getName(), e);
}
}
} else {

View File

@ -1216,9 +1216,8 @@ public class MediaDetection {
}
public static Movie grepMovie(File nfo, MovieIdentificationService resolver, Locale locale) throws Exception {
String text = readTextFile(nfo);
int imdbId = grepImdbId(text).get(0);
return resolver.getMovieDescriptor(new Movie(imdbId), locale);
List<Integer> imdbId = grepImdbId(readTextFile(nfo));
return imdbId.isEmpty() ? null : resolver.getMovieDescriptor(new Movie(imdbId.get(0)), locale);
}
public static SeriesInfo grepSeries(File nfo, Locale locale) throws Exception {

View File

@ -142,8 +142,8 @@ class MovieMatcher implements AutoCompleteMatcher {
}
}
}
} catch (NoSuchElementException e) {
debug.log(Level.WARNING, "Failed to grep IMDbID: " + nfo.getName());
} catch (Exception e) {
debug.log(Level.WARNING, "Failed to grep IMDbID: " + nfo.getName(), e);
}
}