mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-21 23:38:50 -05:00
Remove unused classes
This commit is contained in:
parent
898065db31
commit
04b3110d71
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user