prettier README / better duplicated notification handling

This commit is contained in:
2025-08-15 13:27:29 +02:00
parent 3ba0f3ddcb
commit ddc21e9a57
4 changed files with 143 additions and 5 deletions

View File

@@ -361,9 +361,9 @@ def check_and_notify_users():
html = render_to_string('arr_api/email/new_media_notification.html', ctx)
except Exception:
pass
_dispatch_user_notification(sub.user, subject=subj, body_text=body, html_message=html)
ok = _dispatch_user_notification(sub.user, subject=subj, body_text=body, html_message=html)
# mark as sent unless duplicates are allowed
if not getattr(settings, 'NOTIFICATIONS_ALLOW_DUPLICATES', False):
if ok and not getattr(settings, 'NOTIFICATIONS_ALLOW_DUPLICATES', False):
SentNotification.objects.create(
user=sub.user,
media_id=sub.series_id,
@@ -423,8 +423,8 @@ def check_and_notify_users():
html = render_to_string('arr_api/email/new_media_notification.html', ctx)
except Exception:
pass
_dispatch_user_notification(sub.user, subject=subj, body_text=body, html_message=html)
if not getattr(settings, 'NOTIFICATIONS_ALLOW_DUPLICATES', False):
ok = _dispatch_user_notification(sub.user, subject=subj, body_text=body, html_message=html)
if ok and not getattr(settings, 'NOTIFICATIONS_ALLOW_DUPLICATES', False):
SentNotification.objects.create(
user=sub.user,
media_id=sub.movie_id,