mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-04 08:25:03 -05:00
* allow direct mapping of nfos to movies in the same folder as well as subfolders
This commit is contained in:
parent
077db7af74
commit
36a7eb5e5a
@ -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) {
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user