mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-30 11:38:32 -07:00
Added the test button for mobile notifications
This commit is contained in:
parent
2b227e7201
commit
1935d70cf7
9 changed files with 74 additions and 5 deletions
|
@ -18,7 +18,7 @@ using Ombi.Store.Repository.Requests;
|
|||
|
||||
namespace Ombi.Notifications.Agents
|
||||
{
|
||||
public class MobileNotification : BaseNotification<MobileNotificationSettings>
|
||||
public class MobileNotification : BaseNotification<MobileNotificationSettings>, IMobileNotification
|
||||
{
|
||||
public MobileNotification(IOneSignalApi api, ISettingsService<MobileNotificationSettings> sn, ILogger<MobileNotification> log, INotificationTemplatesRepository r,
|
||||
IMovieRequestRepository m, ITvRequestRepository t, ISettingsService<CustomizationSettings> s, IRepository<NotificationUserId> notification,
|
||||
|
@ -232,7 +232,13 @@ namespace Ombi.Notifications.Agents
|
|||
Message = message,
|
||||
};
|
||||
// Send to user
|
||||
var playerIds = await GetAdmins(NotificationType.RequestAvailable);
|
||||
var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id.Equals(model.UserId));
|
||||
if (user == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var playerIds = user.NotificationUserIds.Select(x => x.PlayerId).ToList();
|
||||
await Send(playerIds, notification, settings);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue