From 88b1472f880169d7ea6291b23aec6a42cfc120e4 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Thu, 8 Dec 2016 14:32:08 +0000 Subject: [PATCH 01/12] Tidied up the warnings --- PlexRequests.Helpers/Analytics/Analytics.cs | 3 +++ PlexRequests.Store/Repository/PlexUserRepository.cs | 7 ++++--- PlexRequests.Store/Repository/UserRepository.cs | 7 ++++--- PlexRequests.UI/Modules/Admin/AdminModule.cs | 12 ++++++------ PlexRequests.UI/Modules/CultureModule.cs | 4 ++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/PlexRequests.Helpers/Analytics/Analytics.cs b/PlexRequests.Helpers/Analytics/Analytics.cs index b38daca12..ed7eed4fd 100644 --- a/PlexRequests.Helpers/Analytics/Analytics.cs +++ b/PlexRequests.Helpers/Analytics/Analytics.cs @@ -167,6 +167,8 @@ namespace PlexRequests.Helpers.Analytics } #endif } + +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously private async Task SendRequestAsync(string postDataString) { var request = (HttpWebRequest)WebRequest.Create(AnalyticsUri); @@ -195,6 +197,7 @@ namespace PlexRequests.Helpers.Analytics } #endif } +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously private Dictionary BuildRequestData(HitType type, string username, string category, string action, string clientId, string label, int? value, string exceptionDescription, int? fatal) { diff --git a/PlexRequests.Store/Repository/PlexUserRepository.cs b/PlexRequests.Store/Repository/PlexUserRepository.cs index 177dab2b5..b706ff201 100644 --- a/PlexRequests.Store/Repository/PlexUserRepository.cs +++ b/PlexRequests.Store/Repository/PlexUserRepository.cs @@ -41,11 +41,9 @@ namespace PlexRequests.Store.Repository public PlexUserRepository(ISqliteConfiguration config, ICacheProvider cache) : base(config,cache) { DbConfig = config; - Cache = cache; } private ISqliteConfiguration DbConfig { get; } - private ICacheProvider Cache { get; } private IDbConnection Db => DbConfig.DbConnection(); public PlexUsers GetUser(string userGuid) @@ -69,7 +67,9 @@ namespace PlexRequests.Store.Repository return await Db.QueryFirstOrDefaultAsync(sql, new {UserGuid = userguid}); } - #region abstract implimentation + #region abstract implementation + +#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member [Obsolete] public override PlexUsers Get(string id) { @@ -94,6 +94,7 @@ namespace PlexRequests.Store.Repository throw new System.NotImplementedException(); } +#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member #endregion } diff --git a/PlexRequests.Store/Repository/UserRepository.cs b/PlexRequests.Store/Repository/UserRepository.cs index d661a30ec..50a513e98 100644 --- a/PlexRequests.Store/Repository/UserRepository.cs +++ b/PlexRequests.Store/Repository/UserRepository.cs @@ -40,11 +40,9 @@ namespace PlexRequests.Store.Repository public UserRepository(ISqliteConfiguration config, ICacheProvider cache) : base(config,cache) { DbConfig = config; - Cache = cache; } private ISqliteConfiguration DbConfig { get; } - private ICacheProvider Cache { get; } private IDbConnection Db => DbConfig.DbConnection(); public UsersModel GetUser(string userGuid) @@ -68,7 +66,9 @@ namespace PlexRequests.Store.Repository return await Db.QueryFirstOrDefaultAsync(sql, new {UserGuid = userguid}); } - #region abstract implimentation + #region abstract implementation + +#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member [Obsolete] public override UsersModel Get(string id) { @@ -93,6 +93,7 @@ namespace PlexRequests.Store.Repository throw new System.NotImplementedException(); } +#pragma warning restore CS0809 // Obsolete member overrides non-obsolete member #endregion } diff --git a/PlexRequests.UI/Modules/Admin/AdminModule.cs b/PlexRequests.UI/Modules/Admin/AdminModule.cs index 80b1ea66c..a9367c1bc 100644 --- a/PlexRequests.UI/Modules/Admin/AdminModule.cs +++ b/PlexRequests.UI/Modules/Admin/AdminModule.cs @@ -227,7 +227,7 @@ namespace PlexRequests.UI.Modules Post["/clearlogs", true] = async (x, ct) => await ClearLogs(); Get["/notificationsettings", true] = async (x, ct) => await NotificationSettings(); - Post["/notificationsettings", true] = async (x, ct) => await SaveNotificationSettings(); + Post["/notificationsettings"] = x => SaveNotificationSettings(); Post["/recentlyAddedTest"] = x => RecentlyAddedTest(); } @@ -287,7 +287,7 @@ namespace PlexRequests.UI.Modules { Analytics.TrackEventAsync(Category.Admin, Action.Save, "CollectAnalyticData turned off", Username, CookieHelper.GetAnalyticClientId(Cookies)); } - var result = PrService.SaveSettings(model); + var result = await PrService.SaveSettingsAsync(model); Analytics.TrackEventAsync(Category.Admin, Action.Save, "PlexRequestSettings", Username, CookieHelper.GetAnalyticClientId(Cookies)); return Response.AsJson(result @@ -520,7 +520,7 @@ namespace PlexRequests.UI.Modules { NotificationService.Subscribe(new EmailMessageNotification(EmailService)); settings.Enabled = true; - NotificationService.Publish(notificationModel, settings); + await NotificationService.Publish(notificationModel, settings); Log.Info("Sent email notification test"); } catch (Exception) @@ -620,7 +620,7 @@ namespace PlexRequests.UI.Modules { NotificationService.Subscribe(new PushbulletNotification(PushbulletApi, PushbulletService)); settings.Enabled = true; - NotificationService.Publish(notificationModel, settings); + await NotificationService.Publish(notificationModel, settings); Log.Info("Sent pushbullet notification test"); } catch (Exception) @@ -686,7 +686,7 @@ namespace PlexRequests.UI.Modules { NotificationService.Subscribe(new PushoverNotification(PushoverApi, PushoverService)); settings.Enabled = true; - NotificationService.Publish(notificationModel, settings); + await NotificationService.Publish(notificationModel, settings); Log.Info("Sent pushover notification test"); } catch (Exception) @@ -1040,7 +1040,7 @@ namespace PlexRequests.UI.Modules return View["NotificationSettings", s]; } - private async Task SaveNotificationSettings() + private Negotiator SaveNotificationSettings() { var model = this.Bind(); return View["NotificationSettings", model]; diff --git a/PlexRequests.UI/Modules/CultureModule.cs b/PlexRequests.UI/Modules/CultureModule.cs index adf5c2348..75426f613 100644 --- a/PlexRequests.UI/Modules/CultureModule.cs +++ b/PlexRequests.UI/Modules/CultureModule.cs @@ -47,12 +47,12 @@ namespace PlexRequests.UI.Modules { Analytics = a; - Get["/", true] = async(x,c) => await SetCulture(); + Get["/"] = x => SetCulture(); } private IAnalytics Analytics { get; } - public async Task SetCulture() + private RedirectResponse SetCulture() { var culture = (string)Request.Query["l"]; var returnUrl = (string)Request.Query["u"]; From b55f1ed231ce26ae39cfbb5904f6bbcaa37cc813 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Thu, 8 Dec 2016 16:10:26 +0000 Subject: [PATCH 02/12] Added logging around the Newsletter #717 --- PlexRequests.Services/Jobs/RecentlyAdded.cs | 22 +++++++++++++++++++- PlexRequests.UI/Modules/Admin/AdminModule.cs | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/PlexRequests.Services/Jobs/RecentlyAdded.cs b/PlexRequests.Services/Jobs/RecentlyAdded.cs index 7706da615..24fa5b58c 100644 --- a/PlexRequests.Services/Jobs/RecentlyAdded.cs +++ b/PlexRequests.Services/Jobs/RecentlyAdded.cs @@ -105,6 +105,7 @@ namespace PlexRequests.Services.Jobs public void Test() { + Log.Debug("Starting Test Newsletter"); var settings = NewsletterSettings.GetSettings(); Start(settings, true); } @@ -113,19 +114,32 @@ namespace PlexRequests.Services.Jobs { var sb = new StringBuilder(); var plexSettings = PlexSettings.GetSettings(); + Log.Debug("Got Plex Settings"); var libs = Api.GetLibrarySections(plexSettings.PlexAuthToken, plexSettings.FullUri); + Log.Debug("Getting Plex Library Sections"); + var tvSection = libs.Directories.FirstOrDefault(x => x.type.Equals(PlexMediaType.Show.ToString(), StringComparison.CurrentCultureIgnoreCase)); + Log.Debug("Filtered sections for TV"); var movieSection = libs.Directories.FirstOrDefault(x => x.type.Equals(PlexMediaType.Movie.ToString(), StringComparison.CurrentCultureIgnoreCase)); - + Log.Debug("Filtered sections for Movies"); + + var recentlyAddedTv = Api.RecentlyAdded(plexSettings.PlexAuthToken, plexSettings.FullUri, tvSection.Key); + Log.Debug("Got RecentlyAdded TV Shows"); var recentlyAddedMovies = Api.RecentlyAdded(plexSettings.PlexAuthToken, plexSettings.FullUri, movieSection.Key); + Log.Debug("Got RecentlyAdded Movies"); + Log.Debug("Started Generating Movie HTML"); GenerateMovieHtml(recentlyAddedMovies, plexSettings, sb); + Log.Debug("Finished Generating Movie HTML"); + Log.Debug("Started Generating TV HTML"); GenerateTvHtml(recentlyAddedTv, plexSettings, sb); + Log.Debug("Finished Generating TV HTML"); var template = new RecentlyAddedTemplate(); var html = template.LoadTemplate(sb.ToString()); + Log.Debug("Loaded the template"); Send(newletterSettings, html, plexSettings, testEmail); } @@ -247,6 +261,7 @@ namespace PlexRequests.Services.Jobs private void Send(NewletterSettings newletterSettings, string html, PlexSettings plexSettings, bool testEmail = false) { + Log.Debug("Entering Send"); var settings = EmailSettings.GetSettings(); if (!settings.Enabled || string.IsNullOrEmpty(settings.EmailHost)) @@ -255,11 +270,13 @@ namespace PlexRequests.Services.Jobs } var body = new BodyBuilder { HtmlBody = html, TextBody = "This email is only available on devices that support HTML." }; + var message = new MimeMessage { Body = body.ToMessageBody(), Subject = "New Content on Plex!", }; + Log.Debug("Created Plain/HTML MIME body"); if (!testEmail) { @@ -284,6 +301,7 @@ namespace PlexRequests.Services.Jobs } } } + message.Bcc.Add(new MailboxAddress(settings.EmailUsername, settings.RecipientEmail)); // Include the admin message.From.Add(new MailboxAddress(settings.EmailUsername, settings.EmailSender)); @@ -302,7 +320,9 @@ namespace PlexRequests.Services.Jobs client.Authenticate(settings.EmailUsername, settings.EmailPassword); } Log.Info("sending message to {0} \r\n from: {1}\r\n Are we authenticated: {2}", message.To, message.From, client.IsAuthenticated); + Log.Debug("Sending"); client.Send(message); + Log.Debug("Sent"); client.Disconnect(true); } } diff --git a/PlexRequests.UI/Modules/Admin/AdminModule.cs b/PlexRequests.UI/Modules/Admin/AdminModule.cs index a9367c1bc..97ac58f14 100644 --- a/PlexRequests.UI/Modules/Admin/AdminModule.cs +++ b/PlexRequests.UI/Modules/Admin/AdminModule.cs @@ -1050,12 +1050,13 @@ namespace PlexRequests.UI.Modules { try { + Log.Debug("Clicked TEST"); RecentlyAdded.Test(); return Response.AsJson(new JsonResponseModel { Result = true, Message = "Sent email to administrator" }); } catch (Exception e) { - + Log.Error(e); return Response.AsJson(new JsonResponseModel { Result = false, Message = e.Message }); } } From d8b619bcc4f56f2504ac2d4626ba74dd53ad6a49 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 8 Dec 2016 20:01:28 +0000 Subject: [PATCH 03/12] another attempt to fix #717 --- PlexRequests.Services/Jobs/RecentlyAdded.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PlexRequests.Services/Jobs/RecentlyAdded.cs b/PlexRequests.Services/Jobs/RecentlyAdded.cs index 24fa5b58c..bc4c2c308 100644 --- a/PlexRequests.Services/Jobs/RecentlyAdded.cs +++ b/PlexRequests.Services/Jobs/RecentlyAdded.cs @@ -202,11 +202,17 @@ namespace PlexRequests.Services.Jobs private void GenerateTvHtml(RecentlyAddedModel tv, PlexSettings plexSettings, StringBuilder sb) { + var orderedTv = tv?._children; + if (orderedTv == null) + { + return; + } + orderedTv = orderedTv.OrderByDescending(x => x?.addedAt.UnixTimeStampToDateTime()).ToList(); // TV sb.Append("

New Episodes:



"); sb.Append( ""); - foreach (var t in tv._children.OrderByDescending(x => x.addedAt.UnixTimeStampToDateTime())) + foreach (var t in orderedTv) { var plexGUID = string.Empty; try From 7881a9d97c60be1928bf54ef4dc68b43f3242947 Mon Sep 17 00:00:00 2001 From: SuperPotatoMen Date: Fri, 9 Dec 2016 00:49:59 +0100 Subject: [PATCH 04/12] Workaround for #748 --- .../Migrations/Version1100.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PlexRequests.Core.Migration/Migrations/Version1100.cs b/PlexRequests.Core.Migration/Migrations/Version1100.cs index 15c127d6e..ab028f847 100644 --- a/PlexRequests.Core.Migration/Migrations/Version1100.cs +++ b/PlexRequests.Core.Migration/Migrations/Version1100.cs @@ -238,18 +238,18 @@ namespace PlexRequests.Core.Migration.Migrations // UI = https://image.tmdb.org/t/p/w150/{{posterPath}} // Update old invalid posters - var allRequests = RequestService.GetAll().ToList(); - - foreach (var req in allRequests) - { - if (req.PosterPath.Contains("https://image.tmdb.org/t/p/w150/")) - { - var newImg = req.PosterPath.Replace("https://image.tmdb.org/t/p/w150/", string.Empty); - req.PosterPath = newImg; - } - } - RequestService.BatchUpdate(allRequests); - } + // var allRequests = RequestService.GetAll().ToList(); + + // foreach (var req in allRequests) + // { + // if (req.PosterPath.Contains("https://image.tmdb.org/t/p/w150/")) + // { + // var newImg = req.PosterPath.Replace("https://image.tmdb.org/t/p/w150/", string.Empty); + // req.PosterPath = newImg; + // } + // } + // RequestService.BatchUpdate(allRequests); + // } private void UpdateAdmin() { From 2fa11280bf595548e87c85b790f2422f3e60c35e Mon Sep 17 00:00:00 2001 From: SuperPotatoMen Date: Fri, 9 Dec 2016 00:54:49 +0100 Subject: [PATCH 05/12] Update Version1100.cs --- PlexRequests.Core.Migration/Migrations/Version1100.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlexRequests.Core.Migration/Migrations/Version1100.cs b/PlexRequests.Core.Migration/Migrations/Version1100.cs index ab028f847..012bcd126 100644 --- a/PlexRequests.Core.Migration/Migrations/Version1100.cs +++ b/PlexRequests.Core.Migration/Migrations/Version1100.cs @@ -249,7 +249,7 @@ namespace PlexRequests.Core.Migration.Migrations // } // } // RequestService.BatchUpdate(allRequests); - // } + } private void UpdateAdmin() { From ded17239348040a143ed75107d90c7450d47e15a Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 9 Dec 2016 08:05:52 +0000 Subject: [PATCH 06/12] Fixed #744 --- PlexRequests.UI/Views/Admin/Authentication.cshtml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PlexRequests.UI/Views/Admin/Authentication.cshtml b/PlexRequests.UI/Views/Admin/Authentication.cshtml index f91826003..d8040b3ba 100644 --- a/PlexRequests.UI/Views/Admin/Authentication.cshtml +++ b/PlexRequests.UI/Views/Admin/Authentication.cshtml @@ -4,10 +4,14 @@ @{ var baseUrl = Html.GetBaseUrl(); var formAction = "/admin/authentication"; + + var usermanagement = "/usermanagement"; if (!string.IsNullOrEmpty(baseUrl.ToHtmlString())) { formAction = "/" + baseUrl.ToHtmlString() + formAction; + usermanagement = "/" + baseUrl.ToHtmlString() + usermanagement; } + }
@@ -50,7 +54,7 @@
- User Management + User Management

From 8acd6a2868c25064e021969b4d362195b32803b1 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 9 Dec 2016 08:09:58 +0000 Subject: [PATCH 07/12] Fixed #748 --- .../Migrations/Version1100.cs | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/PlexRequests.Core.Migration/Migrations/Version1100.cs b/PlexRequests.Core.Migration/Migrations/Version1100.cs index 012bcd126..7e23cbdbe 100644 --- a/PlexRequests.Core.Migration/Migrations/Version1100.cs +++ b/PlexRequests.Core.Migration/Migrations/Version1100.cs @@ -238,18 +238,22 @@ namespace PlexRequests.Core.Migration.Migrations // UI = https://image.tmdb.org/t/p/w150/{{posterPath}} // Update old invalid posters - // var allRequests = RequestService.GetAll().ToList(); - - // foreach (var req in allRequests) - // { - // if (req.PosterPath.Contains("https://image.tmdb.org/t/p/w150/")) - // { - // var newImg = req.PosterPath.Replace("https://image.tmdb.org/t/p/w150/", string.Empty); - // req.PosterPath = newImg; - // } - // } - // RequestService.BatchUpdate(allRequests); - } + var allRequests = RequestService.GetAll(); + if (allRequests == null) + { + return; + } + var requestedModels = allRequests as RequestedModel[] ?? allRequests.ToArray(); + foreach (var req in requestedModels) + { + if (req.PosterPath.Contains("https://image.tmdb.org/t/p/w150/")) + { + var newImg = req.PosterPath.Replace("https://image.tmdb.org/t/p/w150/", string.Empty); + req.PosterPath = newImg; + } + } + RequestService.BatchUpdate(requestedModels); + } private void UpdateAdmin() { From 4d0298bbea5cd0cb621c2a167b9354387b660293 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 9 Dec 2016 08:14:33 +0000 Subject: [PATCH 08/12] Fixed #745 --- PlexRequests.Core/StatusChecker/StatusChecker.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/PlexRequests.Core/StatusChecker/StatusChecker.cs b/PlexRequests.Core/StatusChecker/StatusChecker.cs index 088f881ff..94e33b6b6 100644 --- a/PlexRequests.Core/StatusChecker/StatusChecker.cs +++ b/PlexRequests.Core/StatusChecker/StatusChecker.cs @@ -146,8 +146,17 @@ namespace PlexRequests.Core.StatusChecker eapAtrifactRequest.AddHeader("Authorization", $"Bearer {api}"); eapAtrifactRequest.AddHeader("Content-Type", "application/json"); - var artifactResult = request.ExecuteJson>(eapAtrifactRequest, new Uri(AppveyorApiUrl)).FirstOrDefault(); + var artifactResults = request.ExecuteJson>(eapAtrifactRequest, new Uri(AppveyorApiUrl)); + var artifactResult = artifactResults.FirstOrDefault(); + + if (artifactResult == null) + { + return new StatusModel + { + UpdateAvailable = false + }; + } var downloadLink = $"{AppveyorApiUrl}/buildjobs/{jobId}/artifacts/{artifactResult.fileName}"; var branchDisplay = EnumHelper.GetDisplayValue(branch); From 2dcf57352685759032d2856bb9f647c8c904ce39 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 9 Dec 2016 13:23:18 +0000 Subject: [PATCH 09/12] Added a new permission to bypass the request limit --- PlexRequests.Helpers/Permissions/Permissions.cs | 5 ++++- PlexRequests.UI/Modules/SearchModule.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PlexRequests.Helpers/Permissions/Permissions.cs b/PlexRequests.Helpers/Permissions/Permissions.cs index 74b20992e..57112ee7e 100644 --- a/PlexRequests.Helpers/Permissions/Permissions.cs +++ b/PlexRequests.Helpers/Permissions/Permissions.cs @@ -70,6 +70,9 @@ namespace PlexRequests.Helpers.Permissions UsersCanViewOnlyOwnRequests = 1024, [Display(Name = "Users can only view their own issues")] - UsersCanViewOnlyOwnIssues = 2048 + UsersCanViewOnlyOwnIssues = 2048, + + [Display(Name = "Bypass the request limit")] + BypassRequestLimit = 4096 } } \ No newline at end of file diff --git a/PlexRequests.UI/Modules/SearchModule.cs b/PlexRequests.UI/Modules/SearchModule.cs index c5c02111b..2ce0e9469 100644 --- a/PlexRequests.UI/Modules/SearchModule.cs +++ b/PlexRequests.UI/Modules/SearchModule.cs @@ -1234,7 +1234,7 @@ namespace PlexRequests.UI.Modules if (IsAdmin) return true; - if (ShouldAutoApprove(type,s,Username)) + if (Security.HasPermissions(User, Permissions.BypassRequestLimit)) return true; var requestLimit = GetRequestLimitForType(type, s); From b3d1fbda9b5b3199561dbc892e43c30dc56de34c Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 9 Dec 2016 13:34:42 +0000 Subject: [PATCH 10/12] Fixed an issue where the admin could not be updated --- PlexRequests.UI/Modules/UserManagementModule.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/PlexRequests.UI/Modules/UserManagementModule.cs b/PlexRequests.UI/Modules/UserManagementModule.cs index 4fc7b8d9d..cf7669a57 100644 --- a/PlexRequests.UI/Modules/UserManagementModule.cs +++ b/PlexRequests.UI/Modules/UserManagementModule.cs @@ -192,8 +192,7 @@ namespace PlexRequests.UI.Modules { localUser.Permissions = permissionsValue; localUser.Features = featuresValue; - - + var currentProps = ByteConverterHelper.ReturnObject(localUser.UserProperties); // Let's check if the alias has changed, if so we need to change all the requests associated with this @@ -256,12 +255,11 @@ namespace PlexRequests.UI.Modules private async Task UpdateRequests(string username, string oldAlias, string newAlias) { + var newUsername = string.IsNullOrEmpty(newAlias) ? username : newAlias; // User the username if we are clearing the alias + var olderUsername = string.IsNullOrEmpty(oldAlias) ? username : oldAlias; // Let's check if the alias has changed, if so we need to change all the requests associated with this - if (!oldAlias.Equals(newAlias, StringComparison.CurrentCultureIgnoreCase)) + if (!olderUsername.Equals(newUsername, StringComparison.CurrentCultureIgnoreCase)) { - var newUsername = string.IsNullOrEmpty(newAlias) ? username : newAlias; // User the username if we are clearing the alias - var olderUsername = string.IsNullOrEmpty(oldAlias) ? username : oldAlias; - var requests = await RequestService.GetAllAsync(); // Update all requests var requestsWithThisUser = requests.Where(x => x.RequestedUsers.Contains(olderUsername)).ToList(); From 662588b709ca10c8baa6fdd379a3f765a6d3c865 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Fri, 9 Dec 2016 13:41:05 +0000 Subject: [PATCH 11/12] Removed the trace option from the UI, it is only accessible when appending the url with "?developer" #753 --- PlexRequests.UI/Modules/Admin/AdminModule.cs | 5 ++++- PlexRequests.UI/Views/Admin/Logs.cshtml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PlexRequests.UI/Modules/Admin/AdminModule.cs b/PlexRequests.UI/Modules/Admin/AdminModule.cs index 97ac58f14..64ac7794f 100644 --- a/PlexRequests.UI/Modules/Admin/AdminModule.cs +++ b/PlexRequests.UI/Modules/Admin/AdminModule.cs @@ -742,7 +742,10 @@ namespace PlexRequests.UI.Modules private Negotiator Logs() { - return View["Logs"]; + var model = false; + if (Request.Query["developer"] != null) + model = true; + return View["Logs", model]; } private Response LoadLogs() diff --git a/PlexRequests.UI/Views/Admin/Logs.cshtml b/PlexRequests.UI/Views/Admin/Logs.cshtml index d38658420..5da1d685c 100644 --- a/PlexRequests.UI/Views/Admin/Logs.cshtml +++ b/PlexRequests.UI/Views/Admin/Logs.cshtml @@ -21,7 +21,10 @@