From e35b26c0319ea48ba57201b95c9b2d64c98e0940 Mon Sep 17 00:00:00 2001 From: Feramance Date: Wed, 29 May 2024 23:05:49 +0200 Subject: [PATCH 1/2] This should allow the use of the scripts to be initialised in other scripts rather than only through variables --- Scripts/Shared/Radarr.js | 6 +++--- Scripts/Shared/Sonarr.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/Shared/Radarr.js b/Scripts/Shared/Radarr.js index 4c36a3e..6fc2025 100644 --- a/Scripts/Shared/Radarr.js +++ b/Scripts/Shared/Radarr.js @@ -9,12 +9,12 @@ export class Radarr URL; ApiKey; - constructor() + constructor(URL, ApiKey) { - this.URL = Variables['Radarr.Url']; + this.URL = ((URL) ? URL : Variables['Radarr.Url']); if (!this.URL) MissingVariable('Radarr.Url'); - this.ApiKey = Variables['Radarr.ApiKey']; + this.ApiKey = ((ApiKey) ? ApiKey : Variables['Radarr.ApiKey']); if (!this.ApiKey) MissingVariable('Radarr.ApiKey'); } diff --git a/Scripts/Shared/Sonarr.js b/Scripts/Shared/Sonarr.js index e1d582a..2d10782 100644 --- a/Scripts/Shared/Sonarr.js +++ b/Scripts/Shared/Sonarr.js @@ -11,10 +11,10 @@ export class Sonarr constructor() { - this.URL = Variables['Sonarr.Url']; + this.URL = ((URL) ? URL : Variables['Sonarr.Url']); if (!this.URL) MissingVariable('Sonarr.Url'); - this.ApiKey = Variables['Sonarr.ApiKey']; + this.ApiKey = ((ApiKey) ? ApiKey : Variables['Sonarr.ApiKey']); if (!this.ApiKey) MissingVariable('Sonarr.ApiKey'); } From 1ff13082e25faf45f03ed9f1d2d832c997a46996 Mon Sep 17 00:00:00 2001 From: Feramance <38938175+Feramance@users.noreply.github.com> Date: Wed, 29 May 2024 23:56:51 +0200 Subject: [PATCH 2/2] Update Sonarr.js --- Scripts/Shared/Sonarr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/Shared/Sonarr.js b/Scripts/Shared/Sonarr.js index 2d10782..051ed34 100644 --- a/Scripts/Shared/Sonarr.js +++ b/Scripts/Shared/Sonarr.js @@ -9,7 +9,7 @@ export class Sonarr URL; ApiKey; - constructor() + constructor(URL, ApiKey) { this.URL = ((URL) ? URL : Variables['Sonarr.Url']); if (!this.URL)