2017-09-04 02:20:56 +00:00
|
|
|
using System;
|
2020-09-22 20:32:57 +00:00
|
|
|
using System.Runtime.CompilerServices;
|
2013-05-03 05:24:52 +00:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Annotations
|
|
|
|
{
|
|
|
|
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
|
|
|
|
public class FieldDefinitionAttribute : Attribute
|
|
|
|
{
|
|
|
|
public FieldDefinitionAttribute(int order)
|
|
|
|
{
|
|
|
|
Order = order;
|
|
|
|
}
|
|
|
|
|
2015-05-20 23:22:10 +00:00
|
|
|
public int Order { get; private set; }
|
|
|
|
public string Label { get; set; }
|
2018-06-02 01:59:54 +00:00
|
|
|
public string Unit { get; set; }
|
2015-05-20 23:22:10 +00:00
|
|
|
public string HelpText { get; set; }
|
2023-06-03 21:37:17 +00:00
|
|
|
public string HelpTextWarning { get; set; }
|
2015-05-20 23:22:10 +00:00
|
|
|
public string HelpLink { get; set; }
|
2013-05-20 04:19:54 +00:00
|
|
|
public FieldType Type { get; set; }
|
2015-10-03 17:45:26 +00:00
|
|
|
public bool Advanced { get; set; }
|
2013-06-13 07:20:33 +00:00
|
|
|
public Type SelectOptions { get; set; }
|
2020-10-08 21:33:13 +00:00
|
|
|
public string SelectOptionsProviderAction { get; set; }
|
2019-02-23 22:39:11 +00:00
|
|
|
public string Section { get; set; }
|
2019-06-29 22:33:49 +00:00
|
|
|
public HiddenType Hidden { get; set; }
|
2020-09-22 20:31:58 +00:00
|
|
|
public PrivacyLevel Privacy { get; set; }
|
2021-11-14 21:49:21 +00:00
|
|
|
public string Placeholder { get; set; }
|
2013-05-20 04:19:54 +00:00
|
|
|
}
|
|
|
|
|
2020-09-22 20:32:57 +00:00
|
|
|
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
|
|
|
|
public class FieldOptionAttribute : Attribute
|
|
|
|
{
|
|
|
|
public FieldOptionAttribute(string label = null, [CallerLineNumber] int order = 0)
|
|
|
|
{
|
|
|
|
Order = order;
|
|
|
|
Label = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int Order { get; private set; }
|
|
|
|
public string Label { get; set; }
|
|
|
|
public string Hint { get; set; }
|
|
|
|
}
|
|
|
|
|
2023-11-10 16:44:04 +00:00
|
|
|
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
|
|
|
|
public class FieldTokenAttribute : Attribute
|
|
|
|
{
|
|
|
|
public FieldTokenAttribute(TokenField field, string label = "", string token = "", object value = null)
|
|
|
|
{
|
|
|
|
Label = label;
|
|
|
|
Field = field;
|
|
|
|
Token = token;
|
|
|
|
Value = value?.ToString();
|
|
|
|
}
|
|
|
|
|
|
|
|
public string Label { get; set; }
|
|
|
|
public TokenField Field { get; set; }
|
|
|
|
public string Token { get; set; }
|
|
|
|
public string Value { get; set; }
|
|
|
|
}
|
|
|
|
|
2020-10-08 21:33:13 +00:00
|
|
|
public class FieldSelectOption
|
|
|
|
{
|
|
|
|
public int Value { get; set; }
|
|
|
|
public string Name { get; set; }
|
|
|
|
public int Order { get; set; }
|
|
|
|
public string Hint { get; set; }
|
|
|
|
public int? ParentValue { get; set; }
|
|
|
|
}
|
|
|
|
|
2013-05-20 04:19:54 +00:00
|
|
|
public enum FieldType
|
|
|
|
{
|
|
|
|
Textbox,
|
2018-08-08 00:57:15 +00:00
|
|
|
Number,
|
2013-05-20 04:19:54 +00:00
|
|
|
Password,
|
2013-06-13 07:20:33 +00:00
|
|
|
Checkbox,
|
2014-02-14 05:31:49 +00:00
|
|
|
Select,
|
2015-05-13 15:01:39 +00:00
|
|
|
Path,
|
2016-01-28 03:23:22 +00:00
|
|
|
FilePath,
|
2015-06-25 07:10:40 +00:00
|
|
|
Tag,
|
New: Add Webhook support to sonarr
Add Form type url (type=url input field)
Add isValidUrl input type validation
Only allow absolute urls when checking if a url is valid
String => string as per comments that sonarr is standarizing on the lowercase primative
Remove this before function calls
Refactored everything so OnGrab is supported
Don't double submit the webhook
Wrappers around Series, EpisodeFile, Episode so the entire data structure isn't exposed
Add Braces as per style guide
Series.ID and Series.TvdbId should be integers
Reorder webhook payload as per style guide
Upgrade to use ongrab as json instead of string
Add method selection to webhook settings
include episode directly in download event
QualityVersion should be an int and not a string (don't convert it int=>string)
Remove the list of episodes
Add season number to episode data structure
Code Review Fixes:
* Remove episodefile from payload, move everything to episode
* Change episode to a list
convert to var as per code review / style guide
Down with internals
Everything now uses webhookpayload. None of that payload.Message stuff
{"EventType":"Test","Series":{"Id":1,"Title":"Test Title","Path":"C:\\testpath","TvdbId":1234},"Episodes":[{"Id":123,"EpisodeNumber":1,"SeasonNumber":1,"Title":"Test title","AirDate":null,"AirDateUtc":null,"Quality":null,"QualityVersion":0,"ReleaseGroup":null,"SceneName":null}]}
Remove logger and processProvider
Remove unused constructor
2015-08-23 17:51:19 +00:00
|
|
|
Action,
|
2016-08-10 18:45:48 +00:00
|
|
|
Url,
|
2017-09-04 02:20:56 +00:00
|
|
|
Captcha,
|
2018-09-05 02:41:22 +00:00
|
|
|
OAuth,
|
2019-07-24 20:40:30 +00:00
|
|
|
Device,
|
2020-01-07 04:31:33 +00:00
|
|
|
Playlist,
|
2022-12-06 06:58:53 +00:00
|
|
|
TagSelect,
|
2023-10-06 01:13:22 +00:00
|
|
|
RootFolder,
|
2023-10-30 19:28:16 +00:00
|
|
|
QualityProfile,
|
2024-04-07 23:22:21 +00:00
|
|
|
MetadataProfile,
|
|
|
|
ArtistTag
|
2013-05-03 05:24:52 +00:00
|
|
|
}
|
2019-06-29 22:33:49 +00:00
|
|
|
|
|
|
|
public enum HiddenType
|
|
|
|
{
|
|
|
|
Visible,
|
|
|
|
Hidden,
|
|
|
|
HiddenIfNotSet
|
|
|
|
}
|
2020-09-22 20:31:58 +00:00
|
|
|
|
|
|
|
public enum PrivacyLevel
|
|
|
|
{
|
|
|
|
Normal,
|
|
|
|
Password,
|
|
|
|
ApiKey,
|
|
|
|
UserName
|
|
|
|
}
|
2023-11-10 16:44:04 +00:00
|
|
|
|
|
|
|
public enum TokenField
|
|
|
|
{
|
|
|
|
Label,
|
|
|
|
HelpText,
|
|
|
|
HelpTextWarning
|
|
|
|
}
|
2017-09-04 02:20:56 +00:00
|
|
|
}
|