Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Changed name of variables in fresh_tomatoes.py to match project_media.py #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fresh_tomatoes.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,16 @@ def create_movie_tiles_content(movies):
for movie in movies:
# Extract the youtube ID from the url
youtube_id_match = re.search(
r'(?<=v=)[^&#]+', movie.trailer_youtube_url)
r'(?<=v=)[^&#]+', movie.youtube_trailer_url)
youtube_id_match = youtube_id_match or re.search(
r'(?<=be/)[^&#]+', movie.trailer_youtube_url)
r'(?<=be/)[^&#]+', movie.youtube_trailer_url)
trailer_youtube_id = (youtube_id_match.group(0) if youtube_id_match
else None)

# Append the tile for the movie with its content filled in
content += movie_tile_content.format(
movie_title=movie.title,
poster_image_url=movie.poster_image_url,
poster_image_url=movie.poster_image,
trailer_youtube_id=trailer_youtube_id
)
return content
Expand Down