I think the auto updater is finished! #29

This commit is contained in:
tidusjar 2016-05-20 13:51:25 +01:00
parent 0601f04582
commit aa2949cdd0
4 changed files with 56 additions and 6 deletions

View file

@ -54,6 +54,7 @@ using PlexRequests.Store.Repository;
using PlexRequests.UI.Helpers;
using PlexRequests.UI.Models;
using System;
using System.Diagnostics;
using Nancy.Json;
using Nancy.Security;
@ -172,7 +173,9 @@ namespace PlexRequests.UI.Modules
Get["/headphones"] = _ => Headphones();
Post["/headphones"] = _ => SaveHeadphones();
Post ["/createapikey"] = x => CreateApiKey ();
Post["/createapikey"] = x => CreateApiKey();
Post["/autoupdate"] = x => AutoUpdate();
}
private Negotiator Authentication()
@ -496,6 +499,16 @@ namespace PlexRequests.UI.Modules
return View["Status", status];
}
private Response AutoUpdate()
{
var url = Request.Form["url"];
var startInfo = new ProcessStartInfo("PlexRequests.Updater.exe") { Arguments = url};
Process.Start(startInfo);
Environment.Exit(0);
return Nancy.Response.NoBody;
}
private Negotiator PushbulletNotifications()
{
var settings = PushbulletService.GetSettings();