Fixed a bug with tvdb.py
Certain series will return incomplete episode information. If the episode did not contain a first run date, the `get_episode_info` function would return None, but the `tv_next` and `tv_last` functions expected a tuple of three items.
This commit is contained in:
parent
1bca0fa7a9
commit
5ea6135927
|
@ -99,7 +99,12 @@ def tv_next(inp):
|
||||||
today = datetime.date.today()
|
today = datetime.date.today()
|
||||||
|
|
||||||
for episode in reversed(episodes):
|
for episode in reversed(episodes):
|
||||||
(first_aired, airdate, episode_desc) = get_episode_info(episode)
|
ep_info = get_episode_info(episode)
|
||||||
|
|
||||||
|
if ep_info is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
(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)' % (first_aired, episode_desc)]
|
||||||
|
@ -137,7 +142,12 @@ def tv_last(inp):
|
||||||
today = datetime.date.today()
|
today = datetime.date.today()
|
||||||
|
|
||||||
for episode in reversed(episodes):
|
for episode in reversed(episodes):
|
||||||
(first_aired, airdate, episode_desc) = get_episode_info(episode)
|
ep_info = get_episode_info(episode)
|
||||||
|
|
||||||
|
if ep_info is None:
|
||||||
|
continue
|
||||||
|
|
||||||
|
(first_aired, airdate, episode_desc) = ep_info
|
||||||
|
|
||||||
if airdate < today:
|
if airdate < today:
|
||||||
#iterating in reverse order, so the first episode encountered
|
#iterating in reverse order, so the first episode encountered
|
||||||
|
|
Loading…
Reference in New Issue