From accac8c6ab28bd3b6a56915c2bddbe4ee502c1f9 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 22 Feb 2016 18:48:23 +0000 Subject: [PATCH] Adjust differentiation accuracy to about a year --- source/net/filebot/similarity/EpisodeMetrics.java | 2 +- source/net/filebot/web/SimpleDate.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/net/filebot/similarity/EpisodeMetrics.java b/source/net/filebot/similarity/EpisodeMetrics.java index 940df394..7b3707ba 100644 --- a/source/net/filebot/similarity/EpisodeMetrics.java +++ b/source/net/filebot/similarity/EpisodeMetrics.java @@ -534,7 +534,7 @@ public enum EpisodeMetrics implements SimilarityMetric { public float getSimilarity(Object o1, Object o2) { // adjust differentiation accuracy to about a year float f = super.getSimilarity(o1, o2); - return f >= 0.8 ? 1 : f >= 0 ? 0 : -1; + return f >= 0.9 ? 1 : f >= 0 ? 0 : -1; } @Override diff --git a/source/net/filebot/web/SimpleDate.java b/source/net/filebot/web/SimpleDate.java index c9644d85..a578af95 100644 --- a/source/net/filebot/web/SimpleDate.java +++ b/source/net/filebot/web/SimpleDate.java @@ -7,7 +7,6 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Arrays; -import java.util.GregorianCalendar; import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -49,7 +48,7 @@ public class SimpleDate implements Serializable, Comparable { } public long getTimeStamp() { - return new GregorianCalendar(year, month - 1, day).getTimeInMillis(); // Month value is 0-based, e.g. 0 for January + return this.toLocalDate().atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli(); } @Override