diff --git a/fileflows/scripts/Radarr_-_Trigger_Manual_Import.js b/fileflows/scripts/Radarr_-_Trigger_Manual_Import.js index b4c4844..79da0e2 100644 --- a/fileflows/scripts/Radarr_-_Trigger_Manual_Import.js +++ b/fileflows/scripts/Radarr_-_Trigger_Manual_Import.js @@ -2,7 +2,7 @@ * @name Radarr - Trigger Manual Import * @description Safely trigger Radarr ManualImport for exactly one processed file. * @author FileFlows + Sascha - * @revision 11 + * @revision 12 * @output Import erfolgreich * @output Fehler * @param {string} URL Radarr root URL and port @@ -11,11 +11,12 @@ * @param {bool} UseUnmappedPath Whether to Unmap the path * @param {bool} MoveMode Import mode: true=move, false=copy * @param {int} TimeOut Timeout in seconds (max 3600) + * @param {string} PocHoldRelease Exact release title to leave for an external native-scan proof */ import { Radarr } from 'Shared/Radarr'; -function Script(URL, ApiKey, ImportPath, UseUnmappedPath, MoveMode, TimeOut) { +function Script(URL, ApiKey, ImportPath, UseUnmappedPath, MoveMode, TimeOut, PocHoldRelease) { URL = (URL || Variables['Radarr.Url'] || Variables['Radarr.URI']).replace(/\/+$/g, ''); ApiKey = ApiKey || Variables['Radarr.ApiKey']; const currentFile = Variables['file.FullName'] || Variables.file?.FullName || ''; @@ -53,6 +54,11 @@ function Script(URL, ApiKey, ImportPath, UseUnmappedPath, MoveMode, TimeOut) { const searchPatterns = [folderPattern, filePattern] .filter(Boolean) .filter((value, index, values) => values.indexOf(value) === index); + const pocHold = normalizeReleaseTitle(PocHoldRelease || ''); + if (pocHold && searchPatterns.some(pattern => normalizeReleaseTitle(pattern) === pocHold)) { + Logger.ILog(`PoC hold: leaving '${exactImportPath}' on NVMe for external native Arr scan.`); + return 1; + } let movieId = Variables['Radarr.movieId'] ?? null; for (const pattern of searchPatterns) { if (!movieId) {