From 078732e6603cd4709d2733186e40ba8d8ea5151b Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 9 Oct 2016 15:15:44 +0100 Subject: [PATCH 1/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7343239f6..b99ba072d 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ Supported notifications: * Pushbullet * Pushover * Slack +* Weekly Recently Added email notification to all of your Plex Users! # Preview From 44e304a5c259979e29bce8d2e8d752a4664dd1c9 Mon Sep 17 00:00:00 2001 From: Jamie Date: Sun, 9 Oct 2016 18:37:51 +0100 Subject: [PATCH 2/4] Update appveyor.yml --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6c9824580..7282f9b16 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,9 +3,9 @@ configuration: Release assembly_info: patch: true file: '**\AssemblyInfo.*' - assembly_version: '1.9.2' + assembly_version: '1.9.3' assembly_file_version: '{version}' - assembly_informational_version: '1.9.2' + assembly_informational_version: '1.9.3' before_build: - cmd: appveyor-retry nuget restore build: From 41e6d72210bbcd9d76b28770474c1620d7cd0a77 Mon Sep 17 00:00:00 2001 From: Jim MacKenize Date: Mon, 10 Oct 2016 01:59:39 -0500 Subject: [PATCH 3/4] Added Paypalme options, no UI yet (#568) * Added Paypalme options * Added Custom Donation UI * Updated error checking * Review fixes to donation work --- .../SettingModels/PlexRequestSettings.cs | 3 ++ PlexRequests.UI/Modules/DonationLinkModule.cs | 52 +++++++++++++++++++ PlexRequests.UI/PlexRequests.UI.csproj | 1 + PlexRequests.UI/Resources/UI.resx | 3 ++ PlexRequests.UI/Resources/UI1.Designer.cs | 9 ++++ PlexRequests.UI/Views/Admin/Settings.cshtml | 30 ++++++++++- .../Views/Shared/Partial/_Navbar.cshtml | 27 +++++++++- 7 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 PlexRequests.UI/Modules/DonationLinkModule.cs diff --git a/PlexRequests.Core/SettingModels/PlexRequestSettings.cs b/PlexRequests.Core/SettingModels/PlexRequestSettings.cs index 078798b3e..65afd1559 100644 --- a/PlexRequests.Core/SettingModels/PlexRequestSettings.cs +++ b/PlexRequests.Core/SettingModels/PlexRequestSettings.cs @@ -60,6 +60,9 @@ namespace PlexRequests.Core.SettingModels public bool DisableTvRequestsBySeason { get; set; } public bool SendRecentlyAddedEmail { get; set; } + public string CustomDonationUrl { get; set; } + public bool EnableCustomDonationUrl { get; set; } + public string CustomDonationMessage { get; set; } /// /// The CSS name of the theme we want /// diff --git a/PlexRequests.UI/Modules/DonationLinkModule.cs b/PlexRequests.UI/Modules/DonationLinkModule.cs new file mode 100644 index 000000000..9ede62e41 --- /dev/null +++ b/PlexRequests.UI/Modules/DonationLinkModule.cs @@ -0,0 +1,52 @@ +using System; +using System.Threading.Tasks; + +using Nancy; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using NLog; + +using PlexRequests.Core; +using PlexRequests.Core.SettingModels; +using PlexRequests.Helpers; +using PlexRequests.UI.Models; + +namespace PlexRequests.UI.Modules +{ + public class DonationLinkModule : BaseAuthModule + { + public DonationLinkModule(ICacheProvider provider, ISettingsService pr) : base("customDonation", pr) + { + Cache = provider; + + Get["/", true] = async (x, ct) => await GetCustomDonationUrl(pr); + } + + private ICacheProvider Cache { get; } + + private static Logger Log = LogManager.GetCurrentClassLogger(); + + private async Task GetCustomDonationUrl(ISettingsService pr) + { + PlexRequestSettings settings = await pr.GetSettingsAsync(); + try + { + if (settings.EnableCustomDonationUrl) + { + return Response.AsJson(new { url = settings.CustomDonationUrl, message = settings.CustomDonationMessage }); + } + else + { + return Response.AsJson(new { url = settings.CustomDonationUrl, message = settings.CustomDonationMessage }); + } + } + catch (Exception e) + { + Log.Warn("Exception Thrown when attempting to check the custom donation url"); + Log.Warn(e); + return Response.AsJson(new { url = settings.CustomDonationUrl, message = settings.CustomDonationMessage }); + } + } + } + +} diff --git a/PlexRequests.UI/PlexRequests.UI.csproj b/PlexRequests.UI/PlexRequests.UI.csproj index 1df11b208..bd88121f2 100644 --- a/PlexRequests.UI/PlexRequests.UI.csproj +++ b/PlexRequests.UI/PlexRequests.UI.csproj @@ -248,6 +248,7 @@ + diff --git a/PlexRequests.UI/Resources/UI.resx b/PlexRequests.UI/Resources/UI.resx index 4f23fce97..883e20be1 100644 --- a/PlexRequests.UI/Resources/UI.resx +++ b/PlexRequests.UI/Resources/UI.resx @@ -443,4 +443,7 @@ View In Plex + + Donate to Library Maintainer + \ No newline at end of file diff --git a/PlexRequests.UI/Resources/UI1.Designer.cs b/PlexRequests.UI/Resources/UI1.Designer.cs index 6cd282c32..acb53c9bb 100644 --- a/PlexRequests.UI/Resources/UI1.Designer.cs +++ b/PlexRequests.UI/Resources/UI1.Designer.cs @@ -114,6 +114,15 @@ namespace PlexRequests.UI.Resources { } } + /// + /// Looks up a localized string similar to Donate to Library Maintainer. + /// + public static string Custom_Donation_Default { + get { + return ResourceManager.GetString("Custom_Donation_Default", resourceCulture); + } + } + /// /// Looks up a localized string similar to Issue. /// diff --git a/PlexRequests.UI/Views/Admin/Settings.cshtml b/PlexRequests.UI/Views/Admin/Settings.cshtml index 386b209c8..8ed022ee8 100644 --- a/PlexRequests.UI/Views/Admin/Settings.cshtml +++ b/PlexRequests.UI/Views/Admin/Settings.cshtml @@ -273,10 +273,38 @@ } +
+
+ + @if (Model.EnableCustomDonationUrl) + { + + + } + else + { + + } +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + -

A comma separated list of users whose requests do not require approval (These users also do not have a request limit).

+

A comma separated list of users whose requests do not require approval (These users also do not have a request limit).

diff --git a/PlexRequests.UI/Views/Shared/Partial/_Navbar.cshtml b/PlexRequests.UI/Views/Shared/Partial/_Navbar.cshtml index 6692f6f74..8a1826a07 100644 --- a/PlexRequests.UI/Views/Shared/Partial/_Navbar.cshtml +++ b/PlexRequests.UI/Views/Shared/Partial/_Navbar.cshtml @@ -1,6 +1,7 @@ @using Nancy.Security @using Nancy.Session @using Nancy; +@using PlexRequests.Core.SettingModels @using PlexRequests.UI.Helpers @using PlexRequests.UI.Models @using PlexRequests.UI.Resources @@ -38,10 +39,11 @@ {
  • } +
    + \ No newline at end of file From 0b241e0be363ede3ddf9b8b666e5c47fa3c91dd2 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Mon, 10 Oct 2016 10:15:26 +0100 Subject: [PATCH 4/4] Moved the HR inside the table for TV Shows --- PlexRequests.Services/Jobs/RecentlyAdded.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlexRequests.Services/Jobs/RecentlyAdded.cs b/PlexRequests.Services/Jobs/RecentlyAdded.cs index f6b47aab8..83818d627 100644 --- a/PlexRequests.Services/Jobs/RecentlyAdded.cs +++ b/PlexRequests.Services/Jobs/RecentlyAdded.cs @@ -192,10 +192,10 @@ namespace PlexRequests.Services.Jobs string.IsNullOrEmpty(parentMetaData.Directory.Summary) ? info.summary : parentMetaData.Directory.Summary); // Episode Summary sb.Append(""); sb.Append("
    "); sb.Append("
    "); sb.Append("
    "); + sb.Append(""); } sb.Append("

    "); }