Merge branch 'feature/v4' of https://github.com/tidusjar/Ombi into feature/v4

pull/3528/head
tidusjar 5 years ago
commit c6b80c1218

@ -29,7 +29,7 @@ namespace Ombi.Core.Engine.Interfaces
private OmbiUser _user;
protected async Task<OmbiUser> 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<string> UserAlias()

@ -282,7 +282,6 @@ namespace Ombi.Notifications
{nameof(UserPreference),UserPreference},
{nameof(DenyReason),DenyReason},
{nameof(AvailableDate),AvailableDate},
{nameof(RequestId),RequestId},
};
}
}

@ -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;

@ -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],

@ -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<IActionResult> 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();
}
}
}

Loading…
Cancel
Save