* added some extra sanity to series name detection
This commit is contained in:
parent
a2e36c5173
commit
1c8e1972b6
|
@ -297,12 +297,13 @@ public class MediaDetection {
|
||||||
}
|
}
|
||||||
|
|
||||||
// use lenient sub sequence matching only as fallback
|
// use lenient sub sequence matching only as fallback
|
||||||
if (matches.size() > 0) {
|
if (matches.isEmpty()) {
|
||||||
names.addAll(matches);
|
matches.addAll(matchSeriesByName(folders, 3));
|
||||||
} else {
|
matches.addAll(matchSeriesByName(filenames, 3));
|
||||||
names.addAll(matchSeriesByName(folders, 3));
|
|
||||||
names.addAll(matchSeriesByName(filenames, 3));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pass along only valid terms
|
||||||
|
names.addAll(stripBlacklistedTerms(matches));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.getLogger(MediaDetection.class.getClass().getName()).log(Level.WARNING, "Failed to match folder structure: " + e.getMessage(), e);
|
Logger.getLogger(MediaDetection.class.getClass().getName()).log(Level.WARNING, "Failed to match folder structure: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
@ -692,6 +693,18 @@ public class MediaDetection {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<String> stripBlacklistedTerms(Collection<String> names) throws IOException {
|
||||||
|
Pattern blacklist = releaseInfo.getBlacklistPattern();
|
||||||
|
List<String> acceptables = new ArrayList<String>(names.size());
|
||||||
|
for (String it : names) {
|
||||||
|
if (blacklist.matcher(it).replaceAll("").trim().length() > 0) {
|
||||||
|
acceptables.add(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return acceptables;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Set<Integer> grepImdbIdFor(File file) throws Exception {
|
public static Set<Integer> grepImdbIdFor(File file) throws Exception {
|
||||||
Set<Integer> collection = new LinkedHashSet<Integer>();
|
Set<Integer> collection = new LinkedHashSet<Integer>();
|
||||||
List<File> nfoFiles = new ArrayList<File>();
|
List<File> nfoFiles = new ArrayList<File>();
|
||||||
|
|
Loading…
Reference in New Issue