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

* 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,22 +451,24 @@ 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()) {
// resolve movie parts
for (int i = 0; i < fileSet.size(); i++) {
Movie moviePart = entry.getKey();
if (fileSet.size() > 1) {
moviePart = new MoviePart(moviePart, i + 1, fileSet.size());
}
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 = byMovie.getKey();
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
List<File> derivates = derivatesByMovieFile.get(fileSet.get(i));
if (derivates != null) {
for (File derivate : derivates) {
matches.add(new Match<File, Movie>(derivate, moviePart.clone()));
// automatically add matches for derivate files
List<File> derivates = derivatesByMovieFile.get(fileSet.get(i));
if (derivates != null) {
for (File derivate : derivates) {
matches.add(new Match<File, Movie>(derivate, moviePart.clone()));
}
}
}
}

View File

@ -222,21 +222,23 @@ 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()) {
// resolve movie parts
for (int i = 0; i < fileSet.size(); i++) {
Movie moviePart = byMovie.getKey();
if (fileSet.size() > 1) {
moviePart = new MoviePart(moviePart, i + 1, fileSet.size());
}
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();
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
List<File> derivates = derivatesByMovieFile.get(fileSet.get(i));
if (derivates != null) {
for (File derivate : derivates) {
matches.add(new Match<File, Movie>(derivate, moviePart.clone()));
// automatically add matches for derived files
List<File> derivates = derivatesByMovieFile.get(fileSet.get(i));
if (derivates != null) {
for (File derivate : derivates) {
matches.add(new Match<File, Movie>(derivate, moviePart.clone()));
}
}
}
}

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()));