mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 10:05:58 +01:00
Fix filter-date format & add test for filter-date
This commit is contained in:
@@ -33,7 +33,7 @@ public class FileFilter {
|
||||
|
||||
if (!hasMatchingPattern(pathName)
|
||||
|| isExcluded(pathName, new HashSet<>(excluded))
|
||||
|| lastExecutionHandler != null && !isNewOrChanged(pathName)
|
||||
|| lastExecutionHandler != null && !isNewer(pathName, lastExecutionHandler.get(pathName.getAbsolutePath()))
|
||||
|| !isNewer(pathName, filterDate)) {
|
||||
log.debug("Excluded {}", pathName);
|
||||
ResultStatistic.getInstance().excluded();
|
||||
@@ -83,9 +83,4 @@ public class FileFilter {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isNewOrChanged(File pathname) {
|
||||
Instant lastExecutionDate = lastExecutionHandler.get(pathname.getAbsolutePath());
|
||||
return lastExecutionDate == null || isNewer(pathname, lastExecutionDate);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class InputConfig implements CommandLine.IVersionProvider {
|
||||
// TODO: implement usage
|
||||
@Option(names = {"-n", "--only-new-files"}, description = "ignores all files unchanged and previously processed")
|
||||
private boolean onlyNewFiles;
|
||||
@Option(names = {"-d", "--filter-date"}, defaultValue = Option.NULL_VALUE, description = "only consider files created newer than entered date (format: \"dd.MM.yyyy-HH:mm:ss\")")
|
||||
@Option(names = {"-d", "--filter-date"}, defaultValue = Option.NULL_VALUE, description = "only consider files created newer than entered date (following ISO-8601 yyyy-MM-ddTHH:mm:ss.sssZ)")
|
||||
private Instant filterDate;
|
||||
@Option(names = {"-i", "--include-pattern"}, defaultValue = ".*", description = "include files matching pattern")
|
||||
private Pattern includePattern;
|
||||
|
||||
Reference in New Issue
Block a user