mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
Show User Agent in System->Tasks for externally triggered commands (#1047)
* Show User Agent in System->Tasks for externally triggered commands (cherry picked from commit fe8f319f7bfdadb7218b6313ada6cae1d2a35ad8) * Fix ESLint (cherry picked from commit c3837c9f7b50534e3eafe1d9fbaf360fee4588b7) * fixup Co-authored-by: Taloth Saldono <Taloth@users.noreply.github.com> Co-authored-by: Mark McDowall <mark@mcdowall.ca>
This commit is contained in:
@@ -63,6 +63,7 @@ namespace Readarr.Api.V1.Commands
|
||||
command.Trigger = CommandTrigger.Manual;
|
||||
command.SuppressMessages = !command.SendUpdatesToClient;
|
||||
command.SendUpdatesToClient = true;
|
||||
command.ClientUserAgent = Request.Headers["User-Agent"];
|
||||
|
||||
var trackedCommand = _commandQueueManager.Push(command, CommandPriority.Normal, CommandTrigger.Manual);
|
||||
return Created(trackedCommand.Id);
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
using Readarr.Http.REST;
|
||||
|
||||
@@ -23,6 +24,8 @@ namespace Readarr.Api.V1.Commands
|
||||
public string Exception { get; set; }
|
||||
public CommandTrigger Trigger { get; set; }
|
||||
|
||||
public string ClientUserAgent { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string CompletionMessage { get; set; }
|
||||
|
||||
@@ -106,6 +109,8 @@ namespace Readarr.Api.V1.Commands
|
||||
Exception = model.Exception,
|
||||
Trigger = model.Trigger,
|
||||
|
||||
ClientUserAgent = UserAgentParser.SimplifyUserAgent(model.Body.ClientUserAgent),
|
||||
|
||||
CompletionMessage = model.Body.CompletionMessage,
|
||||
LastExecutionTime = model.Body.LastExecutionTime
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user