tvdb.py: When there's a next episode date, provide a time until in the return string.
This commit is contained in:
parent
5301b25cf6
commit
d9b9558776
|
@ -9,7 +9,7 @@ from zipfile import ZipFile
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
from util import hook, http
|
from util import hook, http, timesince
|
||||||
|
|
||||||
|
|
||||||
base_url = "http://thetvdb.com/api/"
|
base_url = "http://thetvdb.com/api/"
|
||||||
|
@ -110,7 +110,7 @@ def tv_next(inp):
|
||||||
(first_aired, airdate, episode_desc) = ep_info
|
(first_aired, airdate, episode_desc) = ep_info
|
||||||
|
|
||||||
if airdate > today:
|
if airdate > today:
|
||||||
next_eps = ['%s (%s)' % (first_aired, episode_desc)]
|
next_eps = ['%s (%s) (%s)' % (first_aired, timesince.timeuntil(datetime.datetime.strptime(first_aired, "%Y-%m-%d")), episode_desc)]
|
||||||
elif airdate == today:
|
elif airdate == today:
|
||||||
next_eps = ['Today (%s)' % episode_desc] + next_eps
|
next_eps = ['Today (%s)' % episode_desc] + next_eps
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue