* improved support for derived files in cmdline -rename mode

@see
http://www.filebot.net/forums/viewtopic.php?f=8&t=668#p4448
This commit is contained in:
Reinhard Pointner 2013-04-14 04:29:41 +00:00
parent 0e8bd858c3
commit 492e20ae8a
2 changed files with 18 additions and 0 deletions

View File

@ -201,6 +201,23 @@ public class CmdlineOperations implements CmdlineInterface {
throw new Exception("Unable to match files to episode data");
}
// handle derived files
List<Match<File, ?>> derivateMatches = new ArrayList<Match<File, ?>>();
SortedSet<File> derivateFiles = new TreeSet<File>(files);
derivateFiles.removeAll(mediaFiles);
for (File file : derivateFiles) {
for (Match<File, ?> match : matches) {
if (file.getParentFile().equals(match.getValue().getParentFile()) && isDerived(file, match.getValue()) && match.getCandidate() instanceof Episode) {
derivateMatches.add(new Match<File, Object>(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 {

View File

@ -97,6 +97,7 @@
<extension>ts</extension>
<extension>tp</extension>
<extension>m2ts</extension>
<extension>rec</extension>
</type>
<type name="video/wmv">
<extension>wmv</extension>