From b97e8d5cf7e16a11152ae1c2df76537887adff02 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 18 Sep 2016 17:39:57 +0100 Subject: [PATCH] Trying to fix the auto CP --- PlexRequests.Helpers.Tests/StringHasherTests.cs | 1 + PlexRequests.Helpers/StringHasher.cs | 2 +- PlexRequests.UI/Views/Admin/CouchPotato.cshtml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PlexRequests.Helpers.Tests/StringHasherTests.cs b/PlexRequests.Helpers.Tests/StringHasherTests.cs index e09fea347..a51482f00 100644 --- a/PlexRequests.Helpers.Tests/StringHasherTests.cs +++ b/PlexRequests.Helpers.Tests/StringHasherTests.cs @@ -46,6 +46,7 @@ namespace PlexRequests.Helpers.Tests { yield return new TestCaseData("hello!").Returns("5a8dd3ad0756a93ded72b823b19dd877").SetName("Hello"); yield return new TestCaseData("0111111").Returns("9549d400a68633435918290085f06293").SetName("Number"); + yield return new TestCaseData("tidusjar").Returns("f47201e0103fa37ca82ce5243cebb9c7").SetName("tidusjar"); yield return new TestCaseData("hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!hello!").Returns("26d0d126918fbecfc0fa4a63070d314c") .SetName("Long string"); } diff --git a/PlexRequests.Helpers/StringHasher.cs b/PlexRequests.Helpers/StringHasher.cs index 41477b7b7..d18083186 100644 --- a/PlexRequests.Helpers/StringHasher.cs +++ b/PlexRequests.Helpers/StringHasher.cs @@ -35,7 +35,7 @@ namespace PlexRequests.Helpers { using (var md5 = MD5.Create()) { - var inputBytes = Encoding.ASCII.GetBytes(input); + var inputBytes = Encoding.UTF8.GetBytes(input); var hash = md5.ComputeHash(inputBytes); var sb = new StringBuilder(); diff --git a/PlexRequests.UI/Views/Admin/CouchPotato.cshtml b/PlexRequests.UI/Views/Admin/CouchPotato.cshtml index bb6f8795f..f4f33cbab 100644 --- a/PlexRequests.UI/Views/Admin/CouchPotato.cshtml +++ b/PlexRequests.UI/Views/Admin/CouchPotato.cshtml @@ -171,7 +171,7 @@ generateNotify("Success!", "success"); $('#ApiKey').val(response.apiKey); } else { - generateNotify(response.message, "warning"); + generateNotify("Could not automatically get the API key", "warning"); } }, error: function (e) {