From: Chris Fulljames Date: Fri, 29 Aug 2025 23:32:38 +0000 (-0400) Subject: Launch push notifications feature X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=c203e3baa3c83aac689ca10c58476764f639cd7d;p=littlesongplace.git Launch push notifications feature --- diff --git a/src/littlesongplace/push_notifications.py b/src/littlesongplace/push_notifications.py index 602758c..55b8cb6 100644 --- a/src/littlesongplace/push_notifications.py +++ b/src/littlesongplace/push_notifications.py @@ -209,18 +209,19 @@ def notify_new_songs_cmd(): new_songs = [s for s in new_songs if not s.hidden] # Filter out hidden songs unique_users = sorted(set(s.username for s in new_songs)) - title = None + title = f"New music!" + body = None _except = None if len(new_songs) == 1: - title = f"New song from {unique_users[0]}" + body = f"New song from {unique_users[0]}" _except = new_songs[0].userid elif len(new_songs) > 1: - title = f"New songs from {', '.join(unique_users)}" + body = f"New songs from {', '.join(unique_users)}" - if title: + if body: notify_all( title, - body=None, + body, url="/", setting=SubscriptionSetting.SONGS, _except=_except) diff --git a/src/littlesongplace/templates/base.html b/src/littlesongplace/templates/base.html index ef16269..4ab6b56 100644 --- a/src/littlesongplace/templates/base.html +++ b/src/littlesongplace/templates/base.html @@ -57,6 +57,7 @@