1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-22 07:48:52 -05:00

Remove unused classes

This commit is contained in:
Reinhard Pointner 2019-06-15 15:12:01 +07:00
parent 898065db31
commit 04b3110d71

View File

@ -1,41 +0,0 @@
package net.filebot.media;
import static net.filebot.Logging.*;
import java.io.File;
import java.io.FileFilter;
public class MediaDurationFilter implements FileFilter {
private final long min;
private final long max;
private final boolean acceptByDefault;
public MediaDurationFilter(long min) {
this(min, Long.MAX_VALUE, false);
}
public MediaDurationFilter(long min, long max, boolean acceptByDefault) {
this.min = min;
this.max = max;
this.acceptByDefault = acceptByDefault;
}
public long getDuration(File f) {
try (MediaCharacteristics mi = MediaCharacteristicsParser.DEFAULT.open(f)) {
return mi.getDuration().toMillis();
} catch (Exception e) {
debug.warning(format("Failed to read video duration: %s", e.getMessage()));
}
return -1;
}
@Override
public boolean accept(File f) {
long d = getDuration(f);
if (d >= 0) {
return d >= min && d <= max;
}
return acceptByDefault;
}
}