Skip to content

Commit

Permalink
Merge pull request #99 from AceFire6/jethro/fix/weak_date_parsing
Browse files Browse the repository at this point in the history
Fix weak date parsing
  • Loading branch information
AceFire6 authored Mar 21, 2019
2 parents c811074 + d658f5f commit 23b4c2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion ordering/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
HOST = '0.0.0.0'
PORT = 5000

CACHE_TYPE = 'redis'
DEBUG = os.getenv('FLASK_DEBUG', False)

CACHE_TYPE = 'redis' if not DEBUG else 'null'
CACHE_REDIS_URL = os.getenv('REDIS_URL', 'redis://localhost:6379')

SEND_FILE_MAX_AGE_DEFAULT = timedelta(weeks=1)
Expand Down
3 changes: 2 additions & 1 deletion ordering/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from concurrent.futures import as_completed, ThreadPoolExecutor
from datetime import datetime

from dateutil.parser import parse as parse_date_string
from operator import itemgetter
import re
Expand Down Expand Up @@ -73,7 +74,7 @@ def get_episode_list(series_soup, series):
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').date()
row[-1] = air_date = parse_date_string(date).date()
except ValueError:
continue

Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FLASK_APP=./ordering/ flask run
FLASK_ENV=development FLASK_DEBUG=1 FLASK_APP=./ordering/ flask run

0 comments on commit 23b4c2f

Please sign in to comment.