Skip to content

Commit 11379dd

Browse files
committed
fix: missing stream for completed item.
1 parent 7fa60f1 commit 11379dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/program/utils/notifications.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def _build_discord_notification(item: MediaItem) -> str:
4141
"""Build a discord notification for the given item using markdown that lists the files completed."""
4242
notification_message = f"### [{item.type.title()}] **{item.log_string}** ({item.aired_at.year})\n"
4343
stream: Stream = next((stream for stream in item.streams if stream.infohash == item.active_stream.get("infohash")), None)
44-
notification_message += f"- {stream.raw_title}\n"
44+
if stream:
45+
notification_message += f"- {stream.raw_title}\n"
4546
return notification_message
4647

4748
def notify_on_complete(item: MediaItem) -> None:

0 commit comments

Comments
 (0)