mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
parent
492b114510
commit
0f2bba0615
42 changed files with 560 additions and 74 deletions
58
src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
Normal file
58
src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using System.Collections.Generic;
|
||||
using FluentValidation.Results;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.Notifications.CustomScript
|
||||
{
|
||||
public class CustomScript : NotificationBase<CustomScriptSettings>
|
||||
{
|
||||
private readonly ICustomScriptService _customScriptService;
|
||||
|
||||
public CustomScript(ICustomScriptService customScriptService)
|
||||
{
|
||||
_customScriptService = customScriptService;
|
||||
}
|
||||
|
||||
public override string Link
|
||||
{
|
||||
get { return "https://github.com/Sonarr/Sonarr/wiki/Custom-Post-Processing-Scripts"; }
|
||||
}
|
||||
|
||||
public override void OnGrab(string message)
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnDownload(DownloadMessage message)
|
||||
{
|
||||
_customScriptService.OnDownload(message.Series, message.EpisodeFile, Settings);
|
||||
}
|
||||
|
||||
public override void OnRename(Series series)
|
||||
{
|
||||
_customScriptService.OnRename(series, Settings);
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Custom Script";
|
||||
}
|
||||
}
|
||||
|
||||
public override bool SupportsOnGrab
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override ValidationResult Test()
|
||||
{
|
||||
var failures = new List<ValidationFailure>();
|
||||
|
||||
return new ValidationResult(failures);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue