This commit is contained in:
ponzischeme89
2026-08-19 06:57:59 +12:00
parent 8c847c59b8
commit 2b43b9ef12
94 changed files with 6359 additions and 778 deletions
+24 -8
View File
@@ -12,6 +12,7 @@ import (
"github.com/ponzischeme89/memby/server/internal/emby"
serverlogging "github.com/ponzischeme89/memby/server/internal/logging"
"github.com/ponzischeme89/memby/server/internal/notify"
"github.com/ponzischeme89/memby/server/internal/store"
)
@@ -950,15 +951,30 @@ func (s *Server) autoFollowContinuingShow(ctx context.Context, sess store.Sessio
s.loggerFor(ctx).Warn("auto-follow notification preferences unavailable", "error", err)
return ""
}
if prefs.Enabled && s.featureEnabled(ctx, featureMyShowsNotification) {
_ = s.store.UpsertNotification(
ctx, sess.EmbyUserID, "auto-follow:"+episode.SeriesID, "auto-follow",
episode.SeriesID, "Added to My Shows",
seriesItem.Name+" was added because you started watching it and it is still continuing.", nil,
)
return seriesItem.Name
notification := notify.Notification{
Kind: "auto-follow",
Source: notifySourceAutoFollow,
UserID: sess.EmbyUserID,
Username: sess.Username,
Title: "Added to My Shows",
Body: seriesItem.Name + " was added because you started watching it and it is still continuing.",
ItemID: episode.SeriesID,
SourceKey: "auto-follow:" + episode.SeriesID,
Metadata: map[string]any{"series": seriesItem.Name},
}
return ""
// The show is followed either way — that is the feature — and only the *notice* is
// conditional. Recording the refusal is what separates "Memby quietly followed this for
// you" from a bug, which from the viewer's side look the same.
if !prefs.Enabled {
s.declineUser(ctx, notification, "this viewer has notifications switched off")
return ""
}
if !s.featureEnabled(ctx, featureMyShowsNotification) {
s.declineUser(ctx, notification, "the My Shows notification feature is switched off")
return ""
}
s.notifyUser(ctx, notification)
return seriesItem.Name
}
func max64(v, floor int64) int64 {