mirror of
https://github.com/Radarr/Radarr
synced 2024-12-25 09:21:57 +00:00
Timers are now initialized on startup.
This commit is contained in:
parent
38712c7e5f
commit
6caae19430
4 changed files with 96 additions and 0 deletions
|
@ -109,9 +109,12 @@ public static void BindKernel()
|
|||
SetupDefaultQualityProfiles(_kernel.Get<IRepository>()); //Setup the default QualityProfiles on start-up
|
||||
|
||||
BindIndexers();
|
||||
BindTimers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static void BindIndexers()
|
||||
{
|
||||
_kernel.Bind<IndexerProviderBase>().To<NzbsOrgProvider>().InSingletonScope();
|
||||
|
@ -122,6 +125,12 @@ private static void BindIndexers()
|
|||
_kernel.Get<IndexerProvider>().InitializeIndexers(indexers.ToList());
|
||||
}
|
||||
|
||||
private static void BindTimers()
|
||||
{
|
||||
_kernel.Bind<ITimer>().To<RssSyncTimer>().InTransientScope();
|
||||
_kernel.Get<TimerProvider>().Initialize();
|
||||
}
|
||||
|
||||
private static void ForceMigration(IRepository repository)
|
||||
{
|
||||
repository.GetPaged<Series>(0, 1);
|
||||
|
|
26
NzbDrone.Web/Controllers/TimersController.cs
Normal file
26
NzbDrone.Web/Controllers/TimersController.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using NzbDrone.Core.Providers.Timers;
|
||||
|
||||
namespace NzbDrone.Web.Controllers
|
||||
{
|
||||
public class TimersController : Controller
|
||||
{
|
||||
private readonly TimerProvider _timerProvider;
|
||||
|
||||
public TimersController(TimerProvider timerProvider)
|
||||
{
|
||||
_timerProvider = timerProvider;
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View(_timerProvider.All());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -202,6 +202,7 @@
|
|||
<Compile Include="Controllers\SeriesController.cs" />
|
||||
<Compile Include="Controllers\SettingsController.cs" />
|
||||
<Compile Include="Controllers\SharedController.cs" />
|
||||
<Compile Include="Controllers\TimersController.cs" />
|
||||
<Compile Include="Controllers\UpcomingController.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
|
@ -662,6 +663,7 @@
|
|||
<Content Include="Scripts\jquery.validate.unobtrusive.min.js" />
|
||||
<Content Include="Views\Web.config" />
|
||||
<Content Include="Views\Settings\Indexers.cshtml" />
|
||||
<Content Include="Views\Timers\index.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
|
|
59
NzbDrone.Web/Views/Timers/index.cshtml
Normal file
59
NzbDrone.Web/Views/Timers/index.cshtml
Normal file
|
@ -0,0 +1,59 @@
|
|||
@model IEnumerable<NzbDrone.Core.Repository.TimerSetting>
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Timers</title>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
</th>
|
||||
<th>
|
||||
Enable
|
||||
</th>
|
||||
<th>
|
||||
TypeName
|
||||
</th>
|
||||
<th>
|
||||
Name
|
||||
</th>
|
||||
<th>
|
||||
Interval
|
||||
</th>
|
||||
<th>
|
||||
LastExecution
|
||||
</th>
|
||||
<th>
|
||||
Success
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@item.Enable
|
||||
</td>
|
||||
<td>
|
||||
@item.TypeName
|
||||
</td>
|
||||
<td>
|
||||
@item.Name
|
||||
</td>
|
||||
<td>
|
||||
@item.Interval
|
||||
</td>
|
||||
<td>
|
||||
@String.Format("{0:g}", item.LastExecution)
|
||||
</td>
|
||||
<td>
|
||||
@item.Success
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue