Merge pull request 'bugfix/references-to-none' (#11) from bugfix/references-to-none into master

Reviewed-on: #11
This commit is contained in:
Sarah 2022-12-10 08:53:05 +00:00
commit 4f0b7213fc
2 changed files with 3 additions and 1 deletions

View File

@ -147,4 +147,4 @@ def generate_imdb_url(imdb_id):
def generate_wikipedia_url(page_title): def generate_wikipedia_url(page_title):
"https://en.wikipedia.org/wiki/{}".format(page_title.replace(" ", "_")) return "https://en.wikipedia.org/wiki/{}".format(page_title.replace(" ", "_"))

View File

@ -37,6 +37,7 @@ def get_films_by_reference(viewings):
except wikipedia.DisambiguationError as e: except wikipedia.DisambiguationError as e:
page_title = e.title page_title = e.title
page_title = page_title[0].upper() + page_title[1:]
page_url = VCinemaUtils.generate_wikipedia_url(page_title) page_url = VCinemaUtils.generate_wikipedia_url(page_title)
except wikipedia.PageError as _: except wikipedia.PageError as _:
try: try:
@ -46,6 +47,7 @@ def get_films_by_reference(viewings):
page_url = referenced_page.url page_url = referenced_page.url
except wikipedia.DisambiguationError as e: except wikipedia.DisambiguationError as e:
page_title = e.title page_title = e.title
page_title = page_title[0].upper() + page_title[1:]
page_url = VCinemaUtils.generate_wikipedia_url(page_title) page_url = VCinemaUtils.generate_wikipedia_url(page_title)
if page_title in films_by_reference.keys(): if page_title in films_by_reference.keys():