From b40647ddf279ae42c76a7b737e5bd7445b33c75b Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 28 Nov 2013 17:36:27 +0000 Subject: [PATCH] * ignore sample/trailer files also automatically in simple -rename calls as well --- source/net/sourceforge/filebot/cli/CmdlineOperations.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index c0245709..2a692142 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -138,7 +138,10 @@ public class CmdlineOperations implements CmdlineInterface { public List renameSeries(Collection files, RenameAction renameAction, ConflictAction conflictAction, File outputDir, ExpressionFormat format, EpisodeListProvider db, String query, SortOrder sortOrder, ExpressionFilter filter, Locale locale, boolean strict) throws Exception { CLILogger.config(format("Rename episodes using [%s]", db.getName())); - List mediaFiles = filter(files, VIDEO_FILES, SUBTITLE_FILES); + // ignore sample files + List fileset = filter(files, not(getClutterFileFilter())); + + List mediaFiles = filter(fileset, VIDEO_FILES, SUBTITLE_FILES); if (mediaFiles.isEmpty()) { throw new Exception("No media files: " + files); } @@ -201,7 +204,7 @@ public class CmdlineOperations implements CmdlineInterface { // handle derived files List> derivateMatches = new ArrayList>(); - SortedSet derivateFiles = new TreeSet(files); + SortedSet derivateFiles = new TreeSet(fileset); derivateFiles.removeAll(mediaFiles); for (File file : derivateFiles) {