Skip to content

Commit

Permalink
Merge pull request #624 from tidusjar/dev
Browse files Browse the repository at this point in the history
Dev fixes
  • Loading branch information
tidusjar authored Oct 28, 2016
2 parents ea2f4d3 + ad57a11 commit 1cc898c
Show file tree
Hide file tree
Showing 7 changed files with 417 additions and 8 deletions.
15 changes: 15 additions & 0 deletions PlexRequests.Core/PlexRequests.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.3.0.0\lib\net40\Common.Logging.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Common.Logging.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<HintPath>..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Data.Sqlite">
<HintPath>..\Assemblies\Mono.Data.Sqlite.dll</HintPath>
</Reference>
Expand All @@ -42,6 +50,10 @@
<HintPath>..\packages\NLog.4.3.6\lib\net45\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Quartz, Version=2.3.3.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4, processorArchitecture=MSIL">
<HintPath>..\packages\Quartz.2.3.3\lib\net40\Quartz.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Windows.Forms" />
Expand Down Expand Up @@ -116,6 +128,9 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="job_scheduling_data_2_0.xsd">
<SubType>Designer</SubType>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
Expand Down
19 changes: 19 additions & 0 deletions PlexRequests.Core/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
using PlexRequests.Store;
using PlexRequests.Store.Repository;
using System.Threading.Tasks;
using Quartz;

namespace PlexRequests.Core
{
Expand Down Expand Up @@ -118,6 +119,24 @@ private void CreateDefaultSettingsPage(string baseUrl)
};
var s = new SettingsServiceV2<PlexRequestSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
s.SaveSettings(defaultSettings);


var cron = (Quartz.Impl.Triggers.CronTriggerImpl)CronScheduleBuilder.WeeklyOnDayAndHourAndMinute(DayOfWeek.Friday, 7, 0).Build();
var scheduled = new ScheduledJobsSettings
{
PlexAvailabilityChecker = 60,
SickRageCacher = 60,
SonarrCacher = 60,
CouchPotatoCacher = 60,
StoreBackup = 24,
StoreCleanup = 24,
UserRequestLimitResetter = 12,
PlexEpisodeCacher = 12,
RecentlyAddedCron = cron.CronExpressionString, // Weekly CRON at 7 am on Mondays
};

var scheduledSettings = new SettingsServiceV2<ScheduledJobsSettings>(new SettingsJsonRepository(new DbConfiguration(new SqliteFactory()), new MemoryCacheProvider()));
scheduledSettings.SaveSettings(scheduled);
}

public void CacheQualityProfiles()
Expand Down
Loading

0 comments on commit 1cc898c

Please sign in to comment.