diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index 1048b7b3..d799523a 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -201,6 +201,23 @@ public class CmdlineOperations implements CmdlineInterface { throw new Exception("Unable to match files to episode data"); } + // handle derived files + List> derivateMatches = new ArrayList>(); + SortedSet derivateFiles = new TreeSet(files); + derivateFiles.removeAll(mediaFiles); + + for (File file : derivateFiles) { + for (Match match : matches) { + if (file.getParentFile().equals(match.getValue().getParentFile()) && isDerived(file, match.getValue()) && match.getCandidate() instanceof Episode) { + derivateMatches.add(new Match(file, ((Episode) match.getCandidate()).clone())); + break; + } + } + } + + // add matches from other files that are linked via filenames + matches.addAll(derivateMatches); + // first write all the metadata if xattr is enabled if (useExtendedFileAttributes()) { try { diff --git a/source/net/sourceforge/filebot/media.types b/source/net/sourceforge/filebot/media.types index 0e7a539d..debe915b 100644 --- a/source/net/sourceforge/filebot/media.types +++ b/source/net/sourceforge/filebot/media.types @@ -97,6 +97,7 @@ ts tp m2ts + rec wmv