0.2.77
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user