multiuser/subscriptions/notifications
This commit is contained in:
14
arr_api/management/commands/check_new_media.py
Normal file
14
arr_api/management/commands/check_new_media.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import timezone
|
||||
from arr_api.notifications import check_and_notify_users
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Prüft neue Medien und sendet Benachrichtigungen'
|
||||
|
||||
def handle(self, *args, **kwargs):
|
||||
self.stdout.write(f'[{timezone.now()}] Starte Medien-Check...')
|
||||
try:
|
||||
check_and_notify_users()
|
||||
self.stdout.write(self.style.SUCCESS(f'[{timezone.now()}] Medien-Check erfolgreich beendet'))
|
||||
except Exception as e:
|
||||
self.stdout.write(self.style.ERROR(f'[{timezone.now()}] Fehler beim Medien-Check: {str(e)}'))
|
Reference in New Issue
Block a user