Send only text notification without art

if `entry["art"]` is empty `pms.get_image` will return `None` and previous implementation would return without sending any notification
Now at lest the text notification without image will be sent
This commit is contained in:
Andrea Spacca 2021-05-06 10:19:39 +02:00 committed by GitHub
parent b77b361d2a
commit 52bbc4ffca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 7 deletions

View File

@ -44,9 +44,7 @@ async def send_entry(bot, room, entry):
if plexpy:
pms = plexpy.pmsconnect.PmsConnect()
pms_image = pms.get_image(entry["art"], 600, 300)
if not pms_image:
return
if pms_image:
(blob, content_type) = pms_image
matrix_uri = await bot.upload_and_send_image(room, blob, "", True, content_type)