diff --git a/src/Ombi/Controllers/IdentityController.cs b/src/Ombi/Controllers/IdentityController.cs index 33409ed7a..d9d8be7b1 100644 --- a/src/Ombi/Controllers/IdentityController.cs +++ b/src/Ombi/Controllers/IdentityController.cs @@ -579,11 +579,11 @@ namespace Ombi.Controllers { Errors = messages }; - } + } // Add the quality profiles if (ui.UserQualityProfiles != null) { - var currentQualityProfiles = await + var currentQualityProfiles = await _userQualityProfiles.GetAll().FirstOrDefaultAsync(x => x.UserId == user.Id); var add = false; if (currentQualityProfiles == null) @@ -955,19 +955,23 @@ namespace Ombi.Controllers // Update it existingPreference.Value = pref.Value; existingPreference.Enabled = pref.Enabled; + await _userNotificationPreferences.SaveChangesAsync(); } - await _userNotificationPreferences.Add(new UserNotificationPreferences + else { - Agent = pref.Agent, - Enabled = pref.Enabled, - UserId = pref.UserId, - Value = pref.Value - }); + await _userNotificationPreferences.Add(new UserNotificationPreferences + { + Agent = pref.Agent, + Enabled = pref.Enabled, + UserId = pref.UserId, + Value = pref.Value + }); + } } return Json(true); } - + private async Task> AddRoles(IEnumerable roles, OmbiUser ombiUser) { var roleResult = new List();