* allow direct mapping of nfos to movies in the same folder as well as subfolders

This commit is contained in:
Reinhard Pointner 2012-04-29 05:59:12 +00:00
parent 077db7af74
commit 36a7eb5e5a
3 changed files with 7 additions and 7 deletions

View File

@ -77,7 +77,7 @@ import net.sourceforge.filebot.web.SortOrder;
import net.sourceforge.filebot.web.SubtitleDescriptor;
import net.sourceforge.filebot.web.SubtitleProvider;
import net.sourceforge.filebot.web.VideoHashSubtitleService;
import net.sourceforge.tuned.FileUtilities.FolderFilter;
import net.sourceforge.tuned.FileUtilities.ParentFilter;
public class CmdlineOperations implements CmdlineInterface {
@ -341,7 +341,7 @@ public class CmdlineOperations implements CmdlineInterface {
movieByFile.put(nfo, movie);
// match movie info to movie files that match the nfo file name
SortedSet<File> siblingMovieFiles = new TreeSet<File>(filter(movieFiles, new FolderFilter(nfo.getParentFile())));
SortedSet<File> siblingMovieFiles = new TreeSet<File>(filter(movieFiles, new ParentFilter(nfo.getParentFile())));
String baseName = stripReleaseInfo(getName(nfo));
for (File movieFile : siblingMovieFiles) {

View File

@ -49,7 +49,7 @@ import net.sourceforge.filebot.web.Movie;
import net.sourceforge.filebot.web.MovieIdentificationService;
import net.sourceforge.filebot.web.MoviePart;
import net.sourceforge.filebot.web.SortOrder;
import net.sourceforge.tuned.FileUtilities.FolderFilter;
import net.sourceforge.tuned.FileUtilities.ParentFilter;
class MovieHashMatcher implements AutoCompleteMatcher {
@ -105,7 +105,7 @@ class MovieHashMatcher implements AutoCompleteMatcher {
movieByFile.put(nfo, movie);
// match movie info to movie files that match the nfo file name
SortedSet<File> siblingMovieFiles = new TreeSet<File>(filter(movieFiles, new FolderFilter(nfo.getParentFile())));
SortedSet<File> siblingMovieFiles = new TreeSet<File>(filter(movieFiles, new ParentFilter(nfo.getParentFile())));
String baseName = stripReleaseInfo(getName(nfo));
for (File movieFile : siblingMovieFiles) {

View File

@ -556,19 +556,19 @@ public final class FileUtilities {
};
public static class FolderFilter implements FileFilter {
public static class ParentFilter implements FileFilter {
private final File folder;
public FolderFilter(File folder) {
public ParentFilter(File folder) {
this.folder = folder;
}
@Override
public boolean accept(File file) {
return file.getParentFile().equals(folder);
return listPath(file).contains(folder);
}
}