Merge pull request 'fix bug' (#12) from bugfix/film-multiple-times-with-same-reference into master

Reviewed-on: #12
This commit is contained in:
Sarah 2022-12-10 09:11:59 +00:00
commit 41860df682
1 changed files with 4 additions and 1 deletions

View File

@ -51,8 +51,11 @@ def get_films_by_reference(viewings):
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():
films_by_reference[page_title]["films"].append(viewing)
films_by_reference[page_title]["keywords"].append(keyword) films_by_reference[page_title]["keywords"].append(keyword)
if viewing not in films_by_reference[page_title]["films"]:
films_by_reference[page_title]["films"].append(viewing)
else: else:
films_by_reference[page_title] = {"url": page_url, films_by_reference[page_title] = {"url": page_url,
"keywords": [keyword], "keywords": [keyword],