Skip to content

Commit

Permalink
Fix that type of video description could be None
Browse files Browse the repository at this point in the history
  • Loading branch information
SeoulSKY committed Jun 29, 2024
1 parent 90037e3 commit b93e28d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ytnoti/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ def _get_kind(self, notification: Notification) -> NotificationKind:
:return: The kind of notification.
"""

if notification.video.timestamp.updated == notification.video.timestamp.published:
return NotificationKind.UPLOAD

return NotificationKind.EDIT if notification.video.id in self._seen_video_ids else NotificationKind.UPLOAD

def _get_listeners(self, kind: NotificationKind, channel_id: str | None) -> list[PushNotificationListener]:
Expand Down Expand Up @@ -519,7 +522,7 @@ async def _post(self, request: Request):
video = Video(
id=entry["yt:videoId"],
title=entry["title"],
description=entry["media:group"]["media:description"],
description=entry["media:group"]["media:description"] or "",
url=entry["link"]["@href"],
thumbnail=thumbnail,
stats=stats,
Expand Down

0 comments on commit b93e28d

Please sign in to comment.