mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-14 17:22:54 -07:00
Merge branch 'master' into dev
This commit is contained in:
commit
1793c6f592
120 changed files with 5943 additions and 5918 deletions
|
@ -257,13 +257,17 @@ namespace PlexRequests.Services.Jobs
|
|||
if (newletterSettings.SendToPlexUsers)
|
||||
{
|
||||
var users = Api.GetUsers(plexSettings.PlexAuthToken);
|
||||
foreach (var user in users.User)
|
||||
if (users != null)
|
||||
{
|
||||
message.Bcc.Add(new MailboxAddress(user.Username, user.Email));
|
||||
foreach (var user in users.User)
|
||||
{
|
||||
message.Bcc.Add(new MailboxAddress(user.Username, user.Email));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (newletterSettings.CustomUsersEmailAddresses.Any())
|
||||
if (newletterSettings.CustomUsersEmailAddresses != null
|
||||
&& newletterSettings.CustomUsersEmailAddresses.Any())
|
||||
{
|
||||
foreach (var user in newletterSettings.CustomUsersEmailAddresses)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#region Copyright
|
||||
|
||||
// /************************************************************************
|
||||
// Copyright (c) 2016 Jamie Rees
|
||||
// File: Scheduler.cs
|
||||
|
@ -23,18 +24,17 @@
|
|||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using NLog;
|
||||
|
||||
using PlexRequests.Core;
|
||||
using PlexRequests.Core.SettingModels;
|
||||
using PlexRequests.Services.Jobs;
|
||||
using PlexRequests.UI.Helpers;
|
||||
|
||||
using Quartz;
|
||||
using Quartz.Impl;
|
||||
|
||||
|
@ -61,20 +61,17 @@ namespace PlexRequests.UI.Jobs
|
|||
|
||||
var jobList = new List<IJobDetail>
|
||||
{
|
||||
JobBuilder.Create<PlexAvailabilityChecker>().WithIdentity("PlexAvailabilityChecker", "Plex").Build(),
|
||||
JobBuilder.Create<PlexEpisodeCacher>().WithIdentity("PlexEpisodeCacher", "Cache").Build(),
|
||||
JobBuilder.Create<SickRageCacher>().WithIdentity("SickRageCacher", "Cache").Build(),
|
||||
JobBuilder.Create<SonarrCacher>().WithIdentity("SonarrCacher", "Cache").Build(),
|
||||
JobBuilder.Create<CouchPotatoCacher>().WithIdentity("CouchPotatoCacher", "Cache").Build(),
|
||||
JobBuilder.Create<StoreBackup>().WithIdentity("StoreBackup", "Database").Build(),
|
||||
JobBuilder.Create<StoreCleanup>().WithIdentity("StoreCleanup", "Database").Build(),
|
||||
JobBuilder.Create<UserRequestLimitResetter>().WithIdentity("UserRequestLimiter", "Request").Build(),
|
||||
JobBuilder.Create<PlexAvailabilityChecker>().WithIdentity("PlexAvailabilityChecker", "Plex").Build(),
|
||||
JobBuilder.Create<PlexEpisodeCacher>().WithIdentity("PlexEpisodeCacher", "Cache").Build(),
|
||||
JobBuilder.Create<SickRageCacher>().WithIdentity("SickRageCacher", "Cache").Build(),
|
||||
JobBuilder.Create<SonarrCacher>().WithIdentity("SonarrCacher", "Cache").Build(),
|
||||
JobBuilder.Create<CouchPotatoCacher>().WithIdentity("CouchPotatoCacher", "Cache").Build(),
|
||||
JobBuilder.Create<StoreBackup>().WithIdentity("StoreBackup", "Database").Build(),
|
||||
JobBuilder.Create<StoreCleanup>().WithIdentity("StoreCleanup", "Database").Build(),
|
||||
JobBuilder.Create<UserRequestLimitResetter>().WithIdentity("UserRequestLimiter", "Request").Build(),
|
||||
JobBuilder.Create<RecentlyAdded>().WithIdentity("RecentlyAddedModel", "Email").Build()
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(s.RecentlyAddedCron))
|
||||
{
|
||||
jobList.Add(JobBuilder.Create<RecentlyAdded>().WithIdentity("RecentlyAddedModel", "Email").Build());
|
||||
}
|
||||
|
||||
|
||||
jobs.AddRange(jobList);
|
||||
|
@ -115,6 +112,47 @@ namespace PlexRequests.UI.Jobs
|
|||
var settingsService = Service.Resolve<ISettingsService<ScheduledJobsSettings>>();
|
||||
var s = settingsService.GetSettings();
|
||||
|
||||
if (s.CouchPotatoCacher == 0)
|
||||
{
|
||||
s.CouchPotatoCacher = 60;
|
||||
}
|
||||
if (s.PlexAvailabilityChecker == 0)
|
||||
{
|
||||
s.PlexAvailabilityChecker = 60;
|
||||
}
|
||||
if (s.PlexEpisodeCacher == 0)
|
||||
{
|
||||
s.PlexEpisodeCacher = 11;
|
||||
}
|
||||
if (string.IsNullOrEmpty(s.RecentlyAddedCron))
|
||||
{
|
||||
var cron =
|
||||
(Quartz.Impl.Triggers.CronTriggerImpl)
|
||||
CronScheduleBuilder.WeeklyOnDayAndHourAndMinute(DayOfWeek.Friday, 7, 0).Build();
|
||||
s.RecentlyAddedCron = cron.CronExpressionString; // Weekly CRON at 7 am on Mondays
|
||||
}
|
||||
if (s.SickRageCacher == 0)
|
||||
{
|
||||
s.SickRageCacher = 60;
|
||||
}
|
||||
if (s.SonarrCacher == 0)
|
||||
{
|
||||
s.SonarrCacher = 60;
|
||||
}
|
||||
if (s.StoreBackup == 0)
|
||||
{
|
||||
s.StoreBackup = 24;
|
||||
}
|
||||
if (s.StoreCleanup == 0)
|
||||
{
|
||||
s.StoreCleanup = 24;
|
||||
}
|
||||
if (s.UserRequestLimitResetter == 0)
|
||||
{
|
||||
s.UserRequestLimitResetter = 12;
|
||||
}
|
||||
|
||||
|
||||
var triggers = new List<ITrigger>();
|
||||
|
||||
var plexAvailabilityChecker =
|
||||
|
@ -175,22 +213,15 @@ namespace PlexRequests.UI.Jobs
|
|||
.Build();
|
||||
|
||||
|
||||
var cronJob = string.IsNullOrEmpty(s.RecentlyAddedCron);
|
||||
if (!cronJob)
|
||||
{
|
||||
var rencentlyAdded =
|
||||
TriggerBuilder.Create()
|
||||
.WithIdentity("RecentlyAddedModel", "Email")
|
||||
.StartNow()
|
||||
.WithCronSchedule(s.RecentlyAddedCron)
|
||||
.WithSimpleSchedule(x => x.WithIntervalInHours(2).RepeatForever())
|
||||
.Build();
|
||||
|
||||
triggers.Add(rencentlyAdded);
|
||||
}
|
||||
|
||||
|
||||
var rencentlyAdded =
|
||||
TriggerBuilder.Create()
|
||||
.WithIdentity("RecentlyAddedModel", "Email")
|
||||
.StartNow()
|
||||
.WithCronSchedule(s.RecentlyAddedCron)
|
||||
.WithSimpleSchedule(x => x.WithIntervalInHours(2).RepeatForever())
|
||||
.Build();
|
||||
|
||||
triggers.Add(rencentlyAdded);
|
||||
triggers.Add(plexAvailabilityChecker);
|
||||
triggers.Add(srCacher);
|
||||
triggers.Add(sonarrCacher);
|
||||
|
|
|
@ -826,7 +826,7 @@ namespace PlexRequests.UI.Modules
|
|||
return Response.AsJson(result
|
||||
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Newsletter!" }
|
||||
: new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Response CreateApiKey()
|
||||
|
|
|
@ -153,8 +153,15 @@ namespace PlexRequests.UI.Modules
|
|||
{
|
||||
return Response.AsJson(valid.SendJsonError());
|
||||
}
|
||||
var currentSettings = await PlexRequestSettings.GetSettingsAsync();
|
||||
currentSettings.SearchForMovies = form.SearchForMovies;
|
||||
currentSettings.SearchForTvShows = form.SearchForTvShows;
|
||||
currentSettings.SearchForMusic = form.SearchForMusic;
|
||||
currentSettings.RequireMovieApproval = form.RequireMovieApproval;
|
||||
currentSettings.RequireTvShowApproval = form.RequireTvShowApproval;
|
||||
currentSettings.RequireMusicApproval = form.RequireMusicApproval;
|
||||
|
||||
var result = await PlexRequestSettings.SaveSettingsAsync(form);
|
||||
var result = await PlexRequestSettings.SaveSettingsAsync(currentSettings);
|
||||
if (result)
|
||||
{
|
||||
return Response.AsJson(new { Result = true });
|
||||
|
@ -190,8 +197,9 @@ namespace PlexRequests.UI.Modules
|
|||
settings.Wizard = true;
|
||||
await PlexRequestSettings.SaveSettingsAsync(settings);
|
||||
|
||||
var baseUrl = string.IsNullOrEmpty(settings.BaseUrl) ? string.Empty : $"/{settings.BaseUrl}";
|
||||
|
||||
return this.LoginAndRedirect((Guid)userId, fallbackRedirectUrl: "/search");
|
||||
return this.LoginAndRedirect((Guid)userId, fallbackRedirectUrl: $"{baseUrl}/search");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -42,9 +42,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="StoreCleanup" class="control-label">Email Addresses to Send to (For users that are not in your Plex Friends)</label>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " placeholder="email@address.com;second@address.com" id="StoreCleanup" name="StoreCleanup" value="@Model.CustomUsers">
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<label for="CustomUsers" class="control-label">Email Addresses to Send to (For users that are not in your Plex Friends)</label>
|
||||
<small>You can add multiple email address by using the ; delimiter</small>
|
||||
<div>
|
||||
<input type="text" class="form-control form-control-custom " placeholder="first@address.com;second@address.com" id="CustomUsers" name="CustomUsers" value="@Model.CustomUsers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -37,14 +37,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequests.Updater", "Ple
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequests.Helpers.Tests", "PlexRequests.Helpers.Tests\PlexRequests.Helpers.Tests.csproj", "{0E6395D3-B074-49E8-898D-0EB99E507E0E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequests.Automation", "PlexRequests.Automation\PlexRequests.Automation.csproj", "{40DC5C6C-2860-44D0-9F91-DEB84C22D103}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Automation", "Automation", "{F9F1B821-AF59-447A-993B-2B328F7274D4}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequests.Automation.Pages", "PlexRequests.Automation.Pages\PlexRequests.Automation.Pages.csproj", "{F8D4A7A7-F0FB-4D04-81DB-637C953E0707}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequestes.Automation.Helpers", "PlexRequestes.Automation.Helpers\PlexRequestes.Automation.Helpers.csproj", "{DC8BACEF-C284-4A8F-A9AA-7F49EFABA288}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlexRequests.Core.Migration", "PlexRequests.Core.Migration\PlexRequests.Core.Migration.csproj", "{8406EE57-D533-47C0-9302-C6B5F8C31E55}"
|
||||
EndProject
|
||||
Global
|
||||
|
@ -101,15 +93,6 @@ Global
|
|||
{0E6395D3-B074-49E8-898D-0EB99E507E0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0E6395D3-B074-49E8-898D-0EB99E507E0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0E6395D3-B074-49E8-898D-0EB99E507E0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{40DC5C6C-2860-44D0-9F91-DEB84C22D103}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{40DC5C6C-2860-44D0-9F91-DEB84C22D103}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{40DC5C6C-2860-44D0-9F91-DEB84C22D103}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F8D4A7A7-F0FB-4D04-81DB-637C953E0707}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F8D4A7A7-F0FB-4D04-81DB-637C953E0707}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F8D4A7A7-F0FB-4D04-81DB-637C953E0707}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DC8BACEF-C284-4A8F-A9AA-7F49EFABA288}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DC8BACEF-C284-4A8F-A9AA-7F49EFABA288}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DC8BACEF-C284-4A8F-A9AA-7F49EFABA288}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8406EE57-D533-47C0-9302-C6B5F8C31E55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8406EE57-D533-47C0-9302-C6B5F8C31E55}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8406EE57-D533-47C0-9302-C6B5F8C31E55}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
@ -118,11 +101,6 @@ Global
|
|||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{40DC5C6C-2860-44D0-9F91-DEB84C22D103} = {F9F1B821-AF59-447A-993B-2B328F7274D4}
|
||||
{F8D4A7A7-F0FB-4D04-81DB-637C953E0707} = {F9F1B821-AF59-447A-993B-2B328F7274D4}
|
||||
{DC8BACEF-C284-4A8F-A9AA-7F49EFABA288} = {F9F1B821-AF59-447A-993B-2B328F7274D4}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
RESX_PrefixTranslations = False
|
||||
EndGlobalSection
|
||||
|
|
|
@ -3,9 +3,9 @@ configuration: Release
|
|||
assembly_info:
|
||||
patch: true
|
||||
file: '**\AssemblyInfo.*'
|
||||
assembly_version: '1.9.6'
|
||||
assembly_version: '1.9.7'
|
||||
assembly_file_version: '{version}'
|
||||
assembly_informational_version: '1.9.6'
|
||||
assembly_informational_version: '1.9.7'
|
||||
before_build:
|
||||
- cmd: appveyor-retry nuget restore
|
||||
build:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue