* make sure to not just reasonable results, that one results is probably better than no result
This commit is contained in:
parent
0daa683cb5
commit
2841ea9552
|
@ -307,6 +307,11 @@ class MovieHashMatcher implements AutoCompleteMatcher {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Movie selectMovie(final File movieFile, final String userQuery, final Collection<Movie> options, final Map<String, Object> memory, final Component parent) throws Exception {
|
protected Movie selectMovie(final File movieFile, final String userQuery, final Collection<Movie> options, final Map<String, Object> memory, final Component parent) throws Exception {
|
||||||
|
// just auto-pick singleton results
|
||||||
|
if (options.size() == 1) {
|
||||||
|
return options.iterator().next();
|
||||||
|
}
|
||||||
|
|
||||||
// 1. movie by filename
|
// 1. movie by filename
|
||||||
final String fileQuery = (userQuery != null) ? userQuery : checkedStripReleaseInfo(movieFile);
|
final String fileQuery = (userQuery != null) ? userQuery : checkedStripReleaseInfo(movieFile);
|
||||||
|
|
||||||
|
@ -319,10 +324,6 @@ class MovieHashMatcher implements AutoCompleteMatcher {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.size() == 1) {
|
|
||||||
return options.iterator().next();
|
|
||||||
}
|
|
||||||
|
|
||||||
// auto-select perfect match
|
// auto-select perfect match
|
||||||
for (Movie movie : options) {
|
for (Movie movie : options) {
|
||||||
String movieIdentifier = normalizePunctuation(movie.toString()).toLowerCase();
|
String movieIdentifier = normalizePunctuation(movie.toString()).toLowerCase();
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
^Download$
|
^Download$
|
||||||
^Downloading$
|
^Downloading$
|
||||||
^Downloads$
|
^Downloads$
|
||||||
|
^Drama$
|
||||||
^Dropbox$
|
^Dropbox$
|
||||||
^emule$
|
^emule$
|
||||||
^Entertainment$
|
^Entertainment$
|
||||||
|
|
Loading…
Reference in New Issue