diff --git a/Ombi.Store/Repository/UserRepository.cs b/Ombi.Store/Repository/UserRepository.cs index 02d699b99..34172ff07 100644 --- a/Ombi.Store/Repository/UserRepository.cs +++ b/Ombi.Store/Repository/UserRepository.cs @@ -47,21 +47,24 @@ namespace Ombi.Store.Repository public UsersModel GetUser(string userGuid) { var sql = @"SELECT * FROM Users - WHERE Userguid = @UserGuid"; + WHERE Userguid = @UserGuid + COLLATE NOCASE"; return Db.QueryFirstOrDefault(sql, new {UserGuid = userGuid}); } public UsersModel GetUserByUsername(string username) { var sql = @"SELECT * FROM Users - WHERE UserName = @UserName"; + WHERE UserName = @UserName + COLLATE NOCASE"; return Db.QueryFirstOrDefault(sql, new {UserName = username}); } public async Task GetUserAsync(string userguid) { var sql = @"SELECT * FROM Users - WHERE UserGuid = @UserGuid"; + WHERE UserGuid = @UserGuid + COLLATE NOCASE"; return await Db.QueryFirstOrDefaultAsync(sql, new {UserGuid = userguid}); } diff --git a/Ombi.UI/Modules/SearchModule.cs b/Ombi.UI/Modules/SearchModule.cs index 0dcc5242b..808fb3023 100644 --- a/Ombi.UI/Modules/SearchModule.cs +++ b/Ombi.UI/Modules/SearchModule.cs @@ -565,7 +565,7 @@ namespace Ombi.UI.Modules }; try { - if (ShouldAutoApprove(RequestType.Movie, settings, Username)) + if (ShouldAutoApprove(RequestType.Movie)) { model.Approved = true; @@ -885,7 +885,7 @@ namespace Ombi.UI.Modules try { - if (ShouldAutoApprove(RequestType.TvShow, settings, Username)) + if (ShouldAutoApprove(RequestType.TvShow)) { model.Approved = true; var s = await sonarrSettings; @@ -981,7 +981,7 @@ namespace Ombi.UI.Modules private bool ShouldSendNotification(RequestType type, PlexRequestSettings prSettings) { - var sendNotification = ShouldAutoApprove(type, prSettings, Username) + var sendNotification = ShouldAutoApprove(type) ? !prSettings.IgnoreNotifyForAutoApprovedRequests : true; @@ -1089,7 +1089,7 @@ namespace Ombi.UI.Modules try { - if (ShouldAutoApprove(RequestType.Album, settings, Username)) + if (ShouldAutoApprove(RequestType.Album)) { model.Approved = true; var hpSettings = HeadphonesService.GetSettings(); @@ -1363,7 +1363,7 @@ namespace Ombi.UI.Modules return diff; } - public bool ShouldAutoApprove(RequestType requestType, PlexRequestSettings prSettings, string username) + public bool ShouldAutoApprove(RequestType requestType) { var admin = Security.HasPermissions(Context.CurrentUser, Permissions.Administrator); // if the user is an admin, they go ahead and allow auto-approval