* slightly improved movie-set auto-detection for better {pi} bindings

This commit is contained in:
Reinhard Pointner 2014-01-02 02:18:17 +00:00
parent 23cff2321c
commit b5461fbf3c
3 changed files with 33 additions and 29 deletions

View File

@ -38,6 +38,7 @@ import java.util.regex.Pattern;
import net.sourceforge.filebot.Analytics;
import net.sourceforge.filebot.HistorySpooler;
import net.sourceforge.filebot.Language;
import net.sourceforge.filebot.MediaTypes;
import net.sourceforge.filebot.RenameAction;
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.SimilarityMetric;
import net.sourceforge.filebot.subtitle.SubtitleFormat;
import net.sourceforge.filebot.Language;
import net.sourceforge.filebot.vfs.MemoryFile;
import net.sourceforge.filebot.web.AudioTrack;
import net.sourceforge.filebot.web.Episode;
@ -451,11 +451,12 @@ public class CmdlineOperations implements CmdlineInterface {
// collect all File/MoviePart matches
List<Match<File, ?>> matches = new ArrayList<Match<File, ?>>();
for (Entry<Movie, SortedSet<File>> entry : filesByMovie.entrySet()) {
for (List<File> fileSet : mapByExtension(entry.getValue()).values()) {
for (Entry<Movie, SortedSet<File>> byMovie : filesByMovie.entrySet()) {
for (List<File> movieFileListByMediaFolder : mapByMediaFolder(byMovie.getValue()).values()) {
for (List<File> fileSet : mapByExtension(movieFileListByMediaFolder).values()) {
// resolve movie parts
for (int i = 0; i < fileSet.size(); i++) {
Movie moviePart = entry.getKey();
Movie moviePart = byMovie.getKey();
if (fileSet.size() > 1) {
moviePart = new MoviePart(moviePart, i + 1, fileSet.size());
}
@ -472,6 +473,7 @@ public class CmdlineOperations implements CmdlineInterface {
}
}
}
}
// first write all the metadata if xattr is enabled
if (useExtendedFileAttributes()) {

View File

@ -222,7 +222,8 @@ class MovieHashMatcher implements AutoCompleteMatcher {
List<Match<File, ?>> matches = new ArrayList<Match<File, ?>>();
for (Entry<Movie, SortedSet<File>> byMovie : filesByMovie.entrySet()) {
for (List<File> fileSet : mapByExtension(byMovie.getValue()).values()) {
for (List<File> movieFileListByMediaFolder : mapByMediaFolder(byMovie.getValue()).values()) {
for (List<File> fileSet : mapByExtension(movieFileListByMediaFolder).values()) {
// resolve movie parts
for (int i = 0; i < fileSet.size(); i++) {
Movie moviePart = byMovie.getKey();
@ -242,6 +243,7 @@ class MovieHashMatcher implements AutoCompleteMatcher {
}
}
}
}
// restore original order
sort(matches, new Comparator<Match<File, ?>>() {

View File

@ -213,7 +213,7 @@ abstract class SubtitleDropTarget extends JButton {
// initialize window properties
dialog.setIconImage(getImage(getIcon(DropAction.Accept)));
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setSize(820, 575);
dialog.setSize(850, 575);
// show dialog
dialog.setLocation(getOffsetLocation(dialog.getOwner()));