Skip to content

Commit

Permalink
Merge pull request #68 from lawrencecurtis/patch-7
Browse files Browse the repository at this point in the history
Update sonarr / radar blockscript to make them catch more
  • Loading branch information
revenz authored Nov 18, 2024
2 parents 1289276 + a6449c2 commit d0e29fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Scripts/Flow/File/File - Blocklist sonarr or radarr.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @author Lawrence Curtis
* @uid 8eb58ddf-f355-4442-8101-d6fd81a1b927
* @description This script will search the active queue and blocklist and research. For use alongside this strategy https://fileflows.com/docs/guides/sonarr-radarr
* @revision 3
* @revision 4
* @param {string} URI Radarr/Sonarr root URI and port (e.g. http://radarr:1234)
* @param {string} ApiKey API Key
* @output Item blocklisted
Expand Down Expand Up @@ -54,13 +54,14 @@ class Blocklist {

check(path) {
let queue = this.getJson("queue?pageSize=9999");
path = path.replace(/\W/gi, '')
if(!queue)
return 2;

let found = false;

queue.records.forEach((item) => {
if (path.includes(item.title)) {
if (path.includes(item.title.replace(/\W/gi, ''))) {
Logger.ILog(`Removing item ${item.title} from ${item.downloadClient}`);
found = true;
let endpoint = `queue/${item.id}?blocklist=true`;
Expand Down

0 comments on commit d0e29fb

Please sign in to comment.