bugfix for missing thumbnail

This commit is contained in:
Carsten Burgard 2022-04-15 14:27:45 +02:00
parent 069d88fd1e
commit aa51cc4301

View File

@ -399,11 +399,15 @@ class Plex(commands.Cog):
ValueError: Unsupported type of embed {type_} ValueError: Unsupported type of embed {type_}
""" """
# Grab the relevant thumbnail # Grab the relevant thumbnail
img_stream = requests.get(track.thumbUrl, stream=True).raw if track.thumbUrl:
img = io.BytesIO(img_stream.read()) img_stream = requests.get(track.thumbUrl, stream=True).raw
img = io.BytesIO(img_stream.read())
# Attach to discord embed # Attach to discord embed
art_file = discord.File(img, filename="image0.png") art_file = discord.File(img, filename="image0.png")
else:
art_file = None
# Get appropiate status message # Get appropiate status message
if type_ == "play": if type_ == "play":
title = f"Now Playing - {track.title}" title = f"Now Playing - {track.title}"