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
This commit is contained in:
Gavin Mogan 2015-08-23 10:51:19 -07:00 committed by Keivan Beigi
parent 187064101c
commit c5b25bcfee
15 changed files with 392 additions and 2 deletions

View file

@ -17,6 +17,10 @@ var _fieldBuilder = function(field) {
return _templateRenderer.call(field, 'Form/HiddenTemplate');
}
if (field.type === 'url') {
return _templateRenderer.call(field, 'Form/UrlTemplate');
}
if (field.type === 'password') {
return _templateRenderer.call(field, 'Form/PasswordTemplate');
}
@ -56,4 +60,4 @@ Handlebars.registerHelper('formBuilder', function() {
});
return new Handlebars.SafeString(ret);
});
});

View file

@ -0,0 +1,8 @@
<div class="form-group {{#if advanced}}advanced-setting{{/if}}">
<label class="col-sm-3 control-label">{{label}}</label>
<div class="col-sm-5">
<input type="url" name="fields.{{order}}.value" validation-name="{{name}}" spellcheck="false" class="form-control"/>
</div>
{{> FormHelpPartial}}
</div>