Skip to content

Commit

Permalink
Fix error preventing episodes with references being shown
Browse files Browse the repository at this point in the history
Fixes #1.
  • Loading branch information
AceFire6 committed Nov 15, 2016
1 parent 8175b76 commit af80b33
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ordering/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import re
import requests

from bs4 import BeautifulSoup
from datetime import datetime
from operator import itemgetter
Expand Down Expand Up @@ -39,7 +41,10 @@ def get_episode_list(series_soup, series):
episode_name = episode_name.split('[')[0]
episode_num = row[-3]
try:
row[-1] = air_date = datetime.strptime(row[-1], '%B %d, %Y')
date = row[-1]
reference = re.search(r'\[\d+\]$', row[-1])
date = date[:reference.start()] if reference else date
row[-1] = air_date = datetime.strptime(date, '%B %d, %Y')
except ValueError:
continue

Expand Down

0 comments on commit af80b33

Please sign in to comment.