* matching: big penalty for episodes not yet aired

This commit is contained in:
Reinhard Pointner 2013-07-09 08:08:50 +00:00
parent a3791d3af4
commit 1027aac904
1 changed files with 8 additions and 1 deletions

View File

@ -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
}