[notifications] Send ntfy on more imports
All checks were successful
build / test (push) Successful in 2m6s
All checks were successful
build / test (push) Successful in 2m6s
This commit is contained in:
@ -93,7 +93,7 @@ fetching and simple saving.
|
|||||||
:LOGBOOK:
|
:LOGBOOK:
|
||||||
CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20
|
CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20
|
||||||
:END:
|
:END:
|
||||||
* Backlog [3/19] :vrobbler:project:personal:
|
* Backlog [4/19] :vrobbler:project:personal:
|
||||||
** TODO [#C] Add sentiment parsing for Scrobbles with notes :vrobbler:project:scrobbles:sentiment:
|
** TODO [#C] Add sentiment parsing for Scrobbles with notes :vrobbler:project:scrobbles:sentiment:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 37781d6a-f3b0-48b2-bf98-33c2c791cf85
|
:ID: 37781d6a-f3b0-48b2-bf98-33c2c791cf85
|
||||||
@ -518,7 +518,7 @@ We should update note rendering to be a simple newest to oldest display in a
|
|||||||
single column with the timestamp has a small header, and the content rendered as
|
single column with the timestamp has a small header, and the content rendered as
|
||||||
markdown with a small bar or horizontal divider marking them from the next note.
|
markdown with a small bar or horizontal divider marking them from the next note.
|
||||||
|
|
||||||
** TODO [#A] Imports should send notifications :feature:notifications:imports:
|
** DONE [#A] Imports should send notifications :feature:notifications:imports:
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:ID: 6f78f8d5-ecaa-4d8a-a666-ae4e27653191
|
:ID: 6f78f8d5-ecaa-4d8a-a666-ae4e27653191
|
||||||
:END:
|
:END:
|
||||||
|
|||||||
@ -8,6 +8,7 @@ from django.contrib.auth import get_user_model
|
|||||||
|
|
||||||
from birds.models import Bird, BirdSightingEntry, BirdSightingLogData, BirdingLocation
|
from birds.models import Bird, BirdSightingEntry, BirdSightingLogData, BirdingLocation
|
||||||
from scrobbles.models import Scrobble
|
from scrobbles.models import Scrobble
|
||||||
|
from scrobbles.notifications import ScrobbleNtfyNotification
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
User = get_user_model()
|
User = get_user_model()
|
||||||
@ -183,4 +184,6 @@ def import_birding_csv(file_path, user_id):
|
|||||||
|
|
||||||
created = Scrobble.objects.bulk_create(new_scrobbles)
|
created = Scrobble.objects.bulk_create(new_scrobbles)
|
||||||
logger.info(f"Created {len(created)} birding scrobbles")
|
logger.info(f"Created {len(created)} birding scrobbles")
|
||||||
|
for scrobble in created:
|
||||||
|
ScrobbleNtfyNotification(scrobble).send()
|
||||||
return created
|
return created
|
||||||
|
|||||||
@ -5,6 +5,7 @@ from datetime import datetime, timedelta
|
|||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
|
|
||||||
from scrobbles.models import Scrobble
|
from scrobbles.models import Scrobble
|
||||||
|
from scrobbles.notifications import ScrobbleNtfyNotification
|
||||||
from tasks.models import Task
|
from tasks.models import Task
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -115,4 +116,6 @@ def import_scale_csv(file_path, user_id):
|
|||||||
|
|
||||||
created = Scrobble.objects.bulk_create(new_scrobbles)
|
created = Scrobble.objects.bulk_create(new_scrobbles)
|
||||||
logger.info(f"Created {len(created)} weigh-in scrobbles")
|
logger.info(f"Created {len(created)} weigh-in scrobbles")
|
||||||
|
for scrobble in created:
|
||||||
|
ScrobbleNtfyNotification(scrobble).send()
|
||||||
return created
|
return created
|
||||||
|
|||||||
@ -12,6 +12,7 @@ from django.core.files import File
|
|||||||
|
|
||||||
from locations.models import GeoLocation
|
from locations.models import GeoLocation
|
||||||
from scrobbles.models import Scrobble
|
from scrobbles.models import Scrobble
|
||||||
|
from scrobbles.notifications import ScrobbleNtfyNotification
|
||||||
from trails.models import Trail, TrailLogData
|
from trails.models import Trail, TrailLogData
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -328,4 +329,6 @@ def import_trail_gpx(file_path, user_id, original_filename=None):
|
|||||||
|
|
||||||
created = Scrobble.objects.bulk_create(new_scrobbles)
|
created = Scrobble.objects.bulk_create(new_scrobbles)
|
||||||
logger.info(f"Created {len(created)} trail scrobbles")
|
logger.info(f"Created {len(created)} trail scrobbles")
|
||||||
|
for scrobble in created:
|
||||||
|
ScrobbleNtfyNotification(scrobble).send()
|
||||||
return created
|
return created
|
||||||
|
|||||||
Reference in New Issue
Block a user