[notifications] Add stop notification utility

This commit is contained in:
2025-03-24 13:23:33 -04:00
parent ac9fc315b1
commit 0a50bca622
4 changed files with 36 additions and 7 deletions

View File

@ -9,7 +9,7 @@ import requests
from books.constants import BOOKS_TITLES_TO_IGNORE
from django.apps import apps
from django.contrib.auth import get_user_model
from scrobbles.utils import send_notifications_for_scrobble
from scrobbles.utils import send_start_notifications_for_scrobble
from stream_sqlite import stream_sqlite
from webdav.client import get_webdav_client
@ -443,7 +443,7 @@ def process_koreader_sqlite_file(file_path, user_id) -> list:
if new_scrobbles:
created = Scrobble.objects.bulk_create(new_scrobbles)
if created:
send_notifications_for_scrobble(created[-1].id)
send_start_notifications_for_scrobble(created[-1].id)
fix_long_play_stats_for_scrobbles(created)
logger.info(
f"Created {len(created)} scrobbles",