From 1027aac90408ea3fb804de747384c1b6f2f481d1 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 9 Jul 2013 08:08:50 +0000 Subject: [PATCH] * matching: big penalty for episodes not yet aired --- .../sourceforge/filebot/similarity/EpisodeMetrics.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java b/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java index fdc06b4e..78934ad7 100644 --- a/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java +++ b/source/net/sourceforge/filebot/similarity/EpisodeMetrics.java @@ -454,7 +454,14 @@ public enum EpisodeMetrics implements SimilarityMetric { public long getTimeStamp(Object object) { if (object instanceof Episode) { try { - return ((Episode) object).airdate().getTimeStamp(); + long ts = ((Episode) object).airdate().getTimeStamp(); + + // big penalty for episodes not yet aired + if (ts > System.currentTimeMillis()) { + return -1; + } + + return ts; } catch (RuntimeException e) { return -1; // some episodes may not have airdate defined }