EQL: Add support for 'age' noun

This is the "episode age in days", i.e. the
amount of days since the episode has been
downloaded (or the downloaded file modified).
This commit is contained in:
Thomas Perl 2012-02-05 13:30:48 +01:00
parent 6670e5e037
commit 0ed4082024
1 changed files with 2 additions and 0 deletions

View File

@ -76,6 +76,8 @@ class Matcher(object):
return episode.description
elif k == 'since':
return (datetime.datetime.now() - datetime.datetime.fromtimestamp(episode.published)).days
elif k == 'age':
return episode.age_in_days()
elif k in ('minutes', 'min'):
return float(episode.total_time) / 60
elif k in ('remaining', 'rem'):