diff --git a/source/net/filebot/media/VideoQuality.java b/source/net/filebot/media/VideoQuality.java index a4d98ab7..946ffc25 100644 --- a/source/net/filebot/media/VideoQuality.java +++ b/source/net/filebot/media/VideoQuality.java @@ -38,7 +38,7 @@ public class VideoQuality implements Comparator { private Optional media(File f) { if (VIDEO_FILES.accept(f) || SUBTITLE_FILES.accept(f)) { - return Optional.of(new MediaBindingBean(null, f, null)); + return Optional.of(new MediaBindingBean(f, f)); } return Optional.empty(); } diff --git a/source/net/filebot/similarity/EpisodeMetrics.java b/source/net/filebot/similarity/EpisodeMetrics.java index ae281476..8507ff10 100644 --- a/source/net/filebot/similarity/EpisodeMetrics.java +++ b/source/net/filebot/similarity/EpisodeMetrics.java @@ -15,8 +15,6 @@ import static net.filebot.util.StringUtilities.*; import java.io.File; import java.time.Instant; import java.time.LocalDate; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.Collection; import java.util.HashMap; @@ -30,9 +28,8 @@ import java.util.stream.Stream; import com.ibm.icu.text.Transliterator; +import net.filebot.format.MediaBindingBean; import net.filebot.media.SmartSeasonEpisodeMatcher; -import net.filebot.mediainfo.MediaInfo; -import net.filebot.mediainfo.MediaInfo.StreamKind; import net.filebot.similarity.SeasonEpisodeMatcher.SxE; import net.filebot.vfs.FileInfo; import net.filebot.web.Episode; @@ -550,12 +547,8 @@ public enum EpisodeMetrics implements SimilarityMetric { private long getTimeStamp(File file) { if (VIDEO_FILES.accept(file) && file.length() > ONE_MEGABYTE) { - try (MediaInfo mi = new MediaInfo().open(file)) { - String date = mi.get(StreamKind.General, 0, "Encoded_Date"); // e.g. UTC 2008-01-08 19:54:39 - if (date.length() > 0) { - ZonedDateTime time = ZonedDateTime.parse(date, DateTimeFormatter.ofPattern("zzz uuuu-MM-dd HH:mm:ss")); - return time.toInstant().toEpochMilli(); - } + try { + return new MediaBindingBean(file, file).getEncodedDate().getTimeStamp(); } catch (Exception e) { debug.warning(format("Failed to read media encoding date: %s", e.getMessage())); }