* slightly improved movie-set auto-detection for better {pi} bindings
This commit is contained in:
parent
23cff2321c
commit
b5461fbf3c
@ -38,6 +38,7 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import net.sourceforge.filebot.Analytics;
|
import net.sourceforge.filebot.Analytics;
|
||||||
import net.sourceforge.filebot.HistorySpooler;
|
import net.sourceforge.filebot.HistorySpooler;
|
||||||
|
import net.sourceforge.filebot.Language;
|
||||||
import net.sourceforge.filebot.MediaTypes;
|
import net.sourceforge.filebot.MediaTypes;
|
||||||
import net.sourceforge.filebot.RenameAction;
|
import net.sourceforge.filebot.RenameAction;
|
||||||
import net.sourceforge.filebot.WebServices;
|
import net.sourceforge.filebot.WebServices;
|
||||||
@ -57,7 +58,6 @@ import net.sourceforge.filebot.similarity.SeriesNameMatcher;
|
|||||||
import net.sourceforge.filebot.similarity.SimilarityComparator;
|
import net.sourceforge.filebot.similarity.SimilarityComparator;
|
||||||
import net.sourceforge.filebot.similarity.SimilarityMetric;
|
import net.sourceforge.filebot.similarity.SimilarityMetric;
|
||||||
import net.sourceforge.filebot.subtitle.SubtitleFormat;
|
import net.sourceforge.filebot.subtitle.SubtitleFormat;
|
||||||
import net.sourceforge.filebot.Language;
|
|
||||||
import net.sourceforge.filebot.vfs.MemoryFile;
|
import net.sourceforge.filebot.vfs.MemoryFile;
|
||||||
import net.sourceforge.filebot.web.AudioTrack;
|
import net.sourceforge.filebot.web.AudioTrack;
|
||||||
import net.sourceforge.filebot.web.Episode;
|
import net.sourceforge.filebot.web.Episode;
|
||||||
@ -451,22 +451,24 @@ public class CmdlineOperations implements CmdlineInterface {
|
|||||||
// collect all File/MoviePart matches
|
// collect all File/MoviePart matches
|
||||||
List<Match<File, ?>> matches = new ArrayList<Match<File, ?>>();
|
List<Match<File, ?>> matches = new ArrayList<Match<File, ?>>();
|
||||||
|
|
||||||
for (Entry<Movie, SortedSet<File>> entry : filesByMovie.entrySet()) {
|
for (Entry<Movie, SortedSet<File>> byMovie : filesByMovie.entrySet()) {
|
||||||
for (List<File> fileSet : mapByExtension(entry.getValue()).values()) {
|
for (List<File> movieFileListByMediaFolder : mapByMediaFolder(byMovie.getValue()).values()) {
|
||||||
// resolve movie parts
|
for (List<File> fileSet : mapByExtension(movieFileListByMediaFolder).values()) {
|
||||||
for (int i = 0; i < fileSet.size(); i++) {
|
// resolve movie parts
|
||||||
Movie moviePart = entry.getKey();
|
for (int i = 0; i < fileSet.size(); i++) {
|
||||||
if (fileSet.size() > 1) {
|
Movie moviePart = byMovie.getKey();
|
||||||
moviePart = new MoviePart(moviePart, i + 1, fileSet.size());
|
if (fileSet.size() > 1) {
|
||||||
}
|
moviePart = new MoviePart(moviePart, i + 1, fileSet.size());
|
||||||
|
}
|
||||||
|
|
||||||
matches.add(new Match<File, Movie>(fileSet.get(i), moviePart.clone()));
|
matches.add(new Match<File, Movie>(fileSet.get(i), moviePart.clone()));
|
||||||
|
|
||||||
// automatically add matches for derivate files
|
// automatically add matches for derivate files
|
||||||
List<File> derivates = derivatesByMovieFile.get(fileSet.get(i));
|
List<File> derivates = derivatesByMovieFile.get(fileSet.get(i));
|
||||||
if (derivates != null) {
|
if (derivates != null) {
|
||||||
for (File derivate : derivates) {
|
for (File derivate : derivates) {
|
||||||
matches.add(new Match<File, Movie>(derivate, moviePart.clone()));
|
matches.add(new Match<File, Movie>(derivate, moviePart.clone()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,21 +222,23 @@ class MovieHashMatcher implements AutoCompleteMatcher {
|
|||||||
List<Match<File, ?>> matches = new ArrayList<Match<File, ?>>();
|
List<Match<File, ?>> matches = new ArrayList<Match<File, ?>>();
|
||||||
|
|
||||||
for (Entry<Movie, SortedSet<File>> byMovie : filesByMovie.entrySet()) {
|
for (Entry<Movie, SortedSet<File>> byMovie : filesByMovie.entrySet()) {
|
||||||
for (List<File> fileSet : mapByExtension(byMovie.getValue()).values()) {
|
for (List<File> movieFileListByMediaFolder : mapByMediaFolder(byMovie.getValue()).values()) {
|
||||||
// resolve movie parts
|
for (List<File> fileSet : mapByExtension(movieFileListByMediaFolder).values()) {
|
||||||
for (int i = 0; i < fileSet.size(); i++) {
|
// resolve movie parts
|
||||||
Movie moviePart = byMovie.getKey();
|
for (int i = 0; i < fileSet.size(); i++) {
|
||||||
if (fileSet.size() > 1) {
|
Movie moviePart = byMovie.getKey();
|
||||||
moviePart = new MoviePart(moviePart, i + 1, fileSet.size());
|
if (fileSet.size() > 1) {
|
||||||
}
|
moviePart = new MoviePart(moviePart, i + 1, fileSet.size());
|
||||||
|
}
|
||||||
|
|
||||||
matches.add(new Match<File, Movie>(fileSet.get(i), moviePart.clone()));
|
matches.add(new Match<File, Movie>(fileSet.get(i), moviePart.clone()));
|
||||||
|
|
||||||
// automatically add matches for derived files
|
// automatically add matches for derived files
|
||||||
List<File> derivates = derivatesByMovieFile.get(fileSet.get(i));
|
List<File> derivates = derivatesByMovieFile.get(fileSet.get(i));
|
||||||
if (derivates != null) {
|
if (derivates != null) {
|
||||||
for (File derivate : derivates) {
|
for (File derivate : derivates) {
|
||||||
matches.add(new Match<File, Movie>(derivate, moviePart.clone()));
|
matches.add(new Match<File, Movie>(derivate, moviePart.clone()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ abstract class SubtitleDropTarget extends JButton {
|
|||||||
// initialize window properties
|
// initialize window properties
|
||||||
dialog.setIconImage(getImage(getIcon(DropAction.Accept)));
|
dialog.setIconImage(getImage(getIcon(DropAction.Accept)));
|
||||||
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||||
dialog.setSize(820, 575);
|
dialog.setSize(850, 575);
|
||||||
|
|
||||||
// show dialog
|
// show dialog
|
||||||
dialog.setLocation(getOffsetLocation(dialog.getOwner()));
|
dialog.setLocation(getOffsetLocation(dialog.getOwner()));
|
||||||
|
Loading…
Reference in New Issue
Block a user