0.3.49
This commit is contained in:
@@ -70,6 +70,15 @@ func (s *Server) runRequestReadyScan(ctx context.Context) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// Retire pins nobody has acted on in a fortnight before looking at anything else, so a
|
||||
// stale REQUEST READY tag is gone from Home within a sweep of its deadline rather than
|
||||
// leaning on SurfacedReadyRequests' own window clause to keep hiding it.
|
||||
if expired, err := s.store.ExpireStaleReadyRequests(ctx); err != nil {
|
||||
s.loggerFor(ctx).Warn("stale request pins not expired", "error", err)
|
||||
} else {
|
||||
s.invalidateHomeFor(ctx, expired...)
|
||||
}
|
||||
|
||||
owned, err := s.store.AllMediaRequests(ctx, store.MediaRequestSweepLimit)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("request arrivals: read requests: %w", err)
|
||||
@@ -112,6 +121,22 @@ func (s *Server) runRequestReadyScan(ctx context.Context) (string, error) {
|
||||
if s.announceRequestReady(ctx, req, card) {
|
||||
announced++
|
||||
}
|
||||
// Pin it to the front of the requester's Continue Watching row until they play
|
||||
// it. Only possible once the library has an item id — a title the *arr reports a
|
||||
// file for but Emby has not imported yet is still worth the notification above,
|
||||
// but there is nothing for a card to open. MarkRequestReadySurfaced's own guard
|
||||
// makes the repeat a no-op, so this is safe to call on every observed transition.
|
||||
if card.EmbyItemID != "" {
|
||||
if err := s.store.MarkRequestReadySurfaced(
|
||||
ctx, req.UserID, req.MediaType, req.ForeignID, card.EmbyItemID,
|
||||
); err != nil {
|
||||
s.loggerFor(ctx).Warn("request ready pin not recorded",
|
||||
"user_id", req.UserID, "type", req.MediaType,
|
||||
"foreign_id", req.ForeignID, "error", err)
|
||||
} else {
|
||||
s.invalidateHomeFor(ctx, req.UserID)
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := s.store.SetMediaRequestStatus(
|
||||
ctx, req.UserID, req.MediaType, req.ForeignID, card.Status,
|
||||
|
||||
Reference in New Issue
Block a user