mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Merge branch 'kay.one' of github.com:NzbDrone/NzbDrone into markus
Conflicts: NzbDrone.Web/NzbDrone.Web.csproj
This commit is contained in:
commit
dff01f984e
5 changed files with 76 additions and 7 deletions
32
NzbDrone.Web/Controllers/UpdateController.cs
Normal file
32
NzbDrone.Web/Controllers/UpdateController.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.Jobs;
|
||||
using NzbDrone.Web.Models;
|
||||
|
||||
namespace NzbDrone.Web.Controllers
|
||||
{
|
||||
public class UpdateController : Controller
|
||||
{
|
||||
private readonly UpdateProvider _updateProvider;
|
||||
private readonly JobProvider _jobProvider;
|
||||
|
||||
public UpdateController(UpdateProvider updateProvider, JobProvider jobProvider)
|
||||
{
|
||||
_updateProvider = updateProvider;
|
||||
_jobProvider = jobProvider;
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View(_updateProvider.GetAvilableUpdate());
|
||||
}
|
||||
|
||||
public ActionResult StartUpdate()
|
||||
{
|
||||
_jobProvider.QueueJob(typeof(AppUpdateJob), 0, 0);
|
||||
|
||||
return Json(new NotificationResult() { Title = "Update will begin shortly", NotificationType = NotificationType.Info, Text = "NzbDrone will restart automatically."});
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue