diff --git a/src/Ombi.Core/Engine/Interfaces/BaseEngine.cs b/src/Ombi.Core/Engine/Interfaces/BaseEngine.cs index c5cb8c45a..81f35383a 100644 --- a/src/Ombi.Core/Engine/Interfaces/BaseEngine.cs +++ b/src/Ombi.Core/Engine/Interfaces/BaseEngine.cs @@ -29,7 +29,7 @@ namespace Ombi.Core.Engine.Interfaces private OmbiUser _user; protected async Task GetUser() { - return _user ?? (_user = await UserManager.Users.FirstOrDefaultAsync(x => x.UserName.Equals(Username, StringComparison.CurrentCultureIgnoreCase))); + return _user ?? (_user = await UserManager.Users.FirstOrDefaultAsync(x => x.UserName == Username)); } protected async Task UserAlias() diff --git a/src/Ombi.Notifications/NotificationMessageCurlys.cs b/src/Ombi.Notifications/NotificationMessageCurlys.cs index def74ea79..8140a4d3f 100644 --- a/src/Ombi.Notifications/NotificationMessageCurlys.cs +++ b/src/Ombi.Notifications/NotificationMessageCurlys.cs @@ -282,7 +282,6 @@ namespace Ombi.Notifications {nameof(UserPreference),UserPreference}, {nameof(DenyReason),DenyReason}, {nameof(AvailableDate),AvailableDate}, - {nameof(RequestId),RequestId}, }; } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts index 8eb595a6c..a4e49a754 100644 --- a/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts @@ -88,7 +88,7 @@ export interface ISonarrSettings extends IExternalSettings { export interface IRadarrSettings extends IExternalSettings { enabled: boolean; apiKey: string; - defaultQualityProfile: string; + defaultQualityProfile: number; defaultRootPath: string; fullRootPath: string; addOnly: boolean; diff --git a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts index d68396a66..4f300de85 100644 --- a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts @@ -34,7 +34,7 @@ export class RadarrComponent implements OnInit { this.form = this.fb.group({ enabled: [x.enabled], apiKey: [x.apiKey, [Validators.required]], - defaultQualityProfile: [x.defaultQualityProfile, [Validators.required]], + defaultQualityProfile: [+x.defaultQualityProfile, [Validators.required]], defaultRootPath: [x.defaultRootPath, [Validators.required]], ssl: [x.ssl], subDir: [x.subDir], diff --git a/src/Ombi/Controllers/V2/MobileController.cs b/src/Ombi/Controllers/V2/MobileController.cs index be96faa98..f6185e18e 100644 --- a/src/Ombi/Controllers/V2/MobileController.cs +++ b/src/Ombi/Controllers/V2/MobileController.cs @@ -13,7 +13,7 @@ using System.Threading.Tasks; namespace Ombi.Controllers.V2 { - [ApiV2] + [ApiV2] [Authorize] [Produces("application/json")] [ApiController] @@ -56,5 +56,26 @@ namespace Ombi.Controllers.V2 } return BadRequest(); } + + [HttpDelete("Notification")] + [ApiExplorerSettings(IgnoreApi = true)] + [ProducesResponseType(400)] + [ProducesResponseType(200)] + public async Task RemoveNotifications() + { + + var user = await _userManager.Users.FirstOrDefaultAsync(x => x.UserName.Equals(User.Identity.Name, StringComparison.InvariantCultureIgnoreCase)); + // Check if we already have this notification id + var currentDevices = await _mobileDevices.GetAll().Where(x => x.UserId == user.Id).ToListAsync(); + + if (currentDevices == null || !currentDevices.Any()) + { + return Ok(); + } + + await _mobileDevices.DeleteRange(currentDevices); + + return Ok(); + } } }