1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-04 16:35:08 -05:00

* clean auto-detect query from release information

This commit is contained in:
Reinhard Pointner 2011-12-03 08:09:37 +00:00
parent 2c6b2bf799
commit b93e85b9dd

View File

@ -17,6 +17,7 @@ import java.io.FileFilter;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@ -28,11 +29,10 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.Map.Entry;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -46,6 +46,7 @@ import net.sourceforge.filebot.format.MediaBindingBean;
import net.sourceforge.filebot.hash.HashType;
import net.sourceforge.filebot.hash.VerificationFileReader;
import net.sourceforge.filebot.hash.VerificationFileWriter;
import net.sourceforge.filebot.mediainfo.ReleaseInfo;
import net.sourceforge.filebot.similarity.EpisodeMetrics;
import net.sourceforge.filebot.similarity.Match;
import net.sourceforge.filebot.similarity.Matcher;
@ -558,6 +559,9 @@ public class CmdlineOperations implements CmdlineInterface {
private Collection<String> detectQuery(Collection<File> mediaFiles, boolean strict) throws Exception {
Collection<String> names = detectSeriesName(mediaFiles);
// clean detected word sequence from unwanted data
names = new LinkedHashSet<String>(new ReleaseInfo().cleanRG(names));
if (names.isEmpty() || (strict && names.size() > 1)) {
throw new Exception("Unable to auto-select query: " + names);
}