This commit is contained in:
ponzischeme89
2026-08-27 15:50:15 +12:00
parent 6b2bf767e2
commit 2f4bd0da31
19 changed files with 456 additions and 144 deletions
+3 -2
View File
@@ -42,6 +42,7 @@ func DefaultNotificationPreferences() NotificationPreferences {
type UserNotification struct {
ID int64 `json:"id"`
Kind string `json:"kind"`
SourceKey string `json:"-"`
ItemID string `json:"itemId,omitempty"`
Title string `json:"title"`
Message string `json:"message"`
@@ -345,7 +346,7 @@ func (s *Store) UpsertNotification(
func (s *Store) UserNotifications(ctx context.Context, userID string) ([]UserNotification, error) {
rows, err := s.pool.Query(ctx, `
SELECT id, kind, item_id, title, message, event_at, created_at, read_at
SELECT id, kind, source_key, item_id, title, message, event_at, created_at, read_at
FROM user_notifications
WHERE emby_user_id = $1 AND dismissed_at IS NULL
ORDER BY created_at DESC LIMIT 100`, userID)
@@ -357,7 +358,7 @@ func (s *Store) UserNotifications(ctx context.Context, userID string) ([]UserNot
for rows.Next() {
var notification UserNotification
if err := rows.Scan(
&notification.ID, &notification.Kind, &notification.ItemID,
&notification.ID, &notification.Kind, &notification.SourceKey, &notification.ItemID,
&notification.Title, &notification.Message, &notification.EventAt,
&notification.CreatedAt, &notification.ReadAt,
); err != nil {