@danimart1991/node-red-radarr-api
Version:
A set of Node-RED nodes to use with Radarr API.
83 lines (77 loc) • 3.55 kB
HTML
<script type="text/html" data-template-name="radarr-api-movie-get">
<div class="form-row">
<label for="node-input-server"><i class="fa fa-server"></i> Server</label>
<input type="text" id="node-input-server" />
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name" />
</div>
<hr align="middle" />
<div class="form-row">
<label for="node-input-movie_id"><i class="fa fa-hashtag"></i> Movie Id</label>
<input type="text" id="node-input-movie_id" placeholder="Optional" />
<input type="hidden" id="node-input-movie_id_type" />
</div>
</script>
<script type="text/html" data-help-name="radarr-api-movie-get">
<p>
Get an <i>Array</i> of all the movies stored in the <i>Radarr</i> database. The <b>Id</b> of a movie can be included as an additional parameter to
obtain only the data of that movie.
</p>
<p>In addition, the second output provides a <b>Log</b> with information on how the execution has worked.</p>
<h3>Parameters</h3>
<dl class="message-properties">
<dt>server <span class="property-type">radarr-api-server</span></dt>
<dd>a <b>Radarr Server</b> previously configured.</dd>
<dt class="optional">movie_id <span class="property-type">number</span></dt>
<dd>a Movie <b>Id</b> used to return only this item.</dd>
</dl>
<h3>Output 1 (Result)</h3>
<dl class="message-properties">
<dt>payload <span class="property-type">object</span></dt>
<dd>an <i>Array</i> with one or more movie <i>objects</i>.</dd>
</dl>
<h3>Output 2 (Log)</h3>
<dl class="message-properties">
<dt>payload.level <span class="property-type">string</span></dt>
<dd>the log <b>Level</b>: <i>Debug</i>, <i>Info</i>, <i>Warn</i>, <i>Error</i>, <i>Critical</i> or <i>Other</i>.</dd>
<dt>payload.message <span class="property-type">string</span></dt>
<dd>the log <b>Message</b>.</dd>
<dt>payload.source.id <span class="property-type">string</span></dt>
<dd>the <b>Id</b> of the node that threw the log.</dd>
<dt>payload.source.type <span class="property-type">string</span></dt>
<dd>the <b>Type</b> of the node that threw the log.</dd>
<dt>payload.source.name <span class="property-type">string</span></dt>
<dd>the <b>Name</b>, if set, of the node that threw the log.</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('radarr-api-movie-get', {
category: 'radarr',
color: '#ffc230',
defaults: {
name: { value: '' },
server: { value: '', type: 'radarr-api-server', required: true },
movie_id: { value: '' },
movie_id_type: { value: 'num' },
},
inputs: 1,
outputs: 2,
icon: 'font-awesome/fa-play',
label: function () {
return this.name || 'get movie/s';
},
paletteLabel: function () {
return 'get movie/s';
},
outputLabels: ['movie/s', 'log'],
oneditprepare: function () {
$('#node-input-movie_id').typedInput({
default: 'num',
typeField: $('#node-input-movie_id_type'),
types: ['num', 'msg', 'flow', 'global'],
});
},
});
</script>