New: OnGrab Notifications

This commit is contained in:
Qstick
2022-11-19 12:07:08 -06:00
parent 99bc56efb6
commit 1640980e2b
48 changed files with 543 additions and 111 deletions
@@ -4,9 +4,7 @@ using System.Linq;
using System.Net;
using Microsoft.AspNetCore.Http;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Exceptions;
namespace Prowlarr.Http.Extensions
{
@@ -129,6 +127,16 @@ namespace Prowlarr.Http.Extensions
return remoteIP.ToString();
}
public static string GetSource(this HttpRequest request)
{
if (request.Headers.TryGetValue("X-Prowlarr-Client", out var source))
{
return "Prowlarr";
}
return NzbDrone.Common.Http.UserAgentParser.ParseSource(request.Headers["User-Agent"]);
}
public static string GetHostName(this HttpRequest request)
{
string ip = request.GetRemoteIP();