1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-04 08:25:03 -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.Locale;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.SortedSet; import java.util.SortedSet;
@ -384,8 +383,8 @@ public class CmdlineOperations implements CmdlineInterface {
} }
} }
} }
} catch (NoSuchElementException e) { } catch (Exception e) {
log.warning("Failed to grep IMDbID: " + nfo.getName()); log.log(Level.WARNING, "Failed to grep IMDbID: " + nfo.getName(), e);
} }
} }
} else { } else {

View File

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

View File

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