From bd33f62065d8c63f3ee3a37fbb619f71c8b39614 Mon Sep 17 00:00:00 2001 From: Mike R Date: Wed, 3 Nov 2021 17:50:41 +0000 Subject: [PATCH] removed plex references --- ....js => Tdarr_Plugin_TD01_TOAD_Autoscan.js} | 68 ++++++++++--------- 1 file changed, 35 insertions(+), 33 deletions(-) rename Community/{Tdarr_Plugin_TD01_TOAD_Plex_Autoscan.js => Tdarr_Plugin_TD01_TOAD_Autoscan.js} (64%) diff --git a/Community/Tdarr_Plugin_TD01_TOAD_Plex_Autoscan.js b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js similarity index 64% rename from Community/Tdarr_Plugin_TD01_TOAD_Plex_Autoscan.js rename to Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js index 16573fc..0e3582b 100644 --- a/Community/Tdarr_Plugin_TD01_TOAD_Plex_Autoscan.js +++ b/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js @@ -1,25 +1,24 @@ -module.exports.dependencies = [ - 'request', -]; +module.exports.dependencies = ['request']; /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ module.exports.details = function details() { return { - id: 'Tdarr_Plugin_TD01_TOAD_Plex_Autoscan', + id: 'Tdarr_Plugin_TD01_TOAD_Autoscan', Stage: 'Post-processing', - Name: 'Trigger Plex_Autoscan.', + Name: 'Trigger Autoscan.', Type: 'Video', Operation: '', - Description: `Connects to plex_autoscan and triggers a manual search within the files directory.\n\n + Description: `Connects to autoscan and triggers a manual search within the files directory.\n\n Works with the hotio autoscan docker that can be found here https://hotio.dev/containers/autoscan/ which \n\n is based on https://github.com/cloudbox/autoscan`, Version: '1.0', - Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_TD01_TOAD_Plex_Autoscan.js', + Link: 'https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_TD01_TOAD_Autoscan.js', Tags: '3rd party,post-processing,configurable', - Inputs: [{ - name: 'autoscan_address', - tooltip: ` + Inputs: [ + { + name: 'autoscan_address', + tooltip: ` Enter the IP address/URL for autoscan. Must include http(s):// \\nExample:\\n @@ -27,15 +26,15 @@ module.exports.details = function details() { \\nExample:\\n https://subdomain.domain.tld`, - }, - { - name: 'autoscan_port', - tooltip: ` + }, + { + name: 'autoscan_port', + tooltip: ` Enter the port Autoscan is using, default is 3468 \\nExample:\\n 3468`, - }, + }, ], }; }; @@ -50,34 +49,37 @@ module.exports.plugin = function plugin(file, librarySettings, inputs) { let filepath = ''; const response = {}; filepath = `${file.file}`; - filepath = `${filepath.split('/').slice(0, -1).join('/')}/`; + filepath = `${filepath + .split('/') + .slice(0, -1) + .join('/')}/`; // Check if all inputs have been configured. If they haven't then exit plugin. - if ( - !inputs.autoscan_address || !inputs.autoscan_port - ) { + if (!inputs.autoscan_address || !inputs.autoscan_port) { response.infoLog += '☒Plugin options have not been configured, please configure options. Skipping this plugin. \n'; response.processFile = false; return response; } // Set content of request/post. - request.post({ - headers: { - 'content-type': 'application/json', + request.post( + { + headers: { + 'content-type': 'application/json', + }, + url: `${ADDRESS}:${PORT}/triggers/manual?dir=${filepath}`, }, - url: `${ADDRESS}:${PORT}/triggers/manual?dir=${filepath}`, - }, - (error, res, body) => { - if (error) { + (error, res, body) => { + if (error) { + // eslint-disable-next-line no-console + console.error(error); + } // eslint-disable-next-line no-console - console.error(error); - } - // eslint-disable-next-line no-console - console.log(`statusCode: ${res.statusCode}`); - // eslint-disable-next-line no-console - console.log(body); - }); + console.log(`statusCode: ${res.statusCode}`); + // eslint-disable-next-line no-console + console.log(body); + }, + ); // eslint-disable-next-line no-console console.log('request next');