From 47ed3472ebb63b9f5bd74aa0a88f2e2201d2680a Mon Sep 17 00:00:00 2001 From: Ben Scobie Date: Thu, 28 Nov 2024 23:10:23 +0000 Subject: [PATCH] fix: Cache reset check failing in some situations The array was being accessed by index instead of the ID. Radarr props index & id do not align due to skipping id 1. --- server/src/modules/rules/rules.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/modules/rules/rules.service.ts b/server/src/modules/rules/rules.service.ts index f088e613b..e3efc6502 100644 --- a/server/src/modules/rules/rules.service.ts +++ b/server/src/modules/rules/rules.service.ts @@ -1012,7 +1012,9 @@ export class RulesService { ); //test first value - const first = firstValApplication.props[parsedRule.firstVal[1]]; + const first = firstValApplication.props.find( + (x) => x.id == parsedRule.firstVal[1], + ); result = first.cacheReset ? true : result; @@ -1021,7 +1023,9 @@ export class RulesService { : undefined; // test second value - const second = secondValApplication?.props[parsedRule.lastVal[1]]; + const second = secondValApplication?.props.find( + (x) => x.id == parsedRule.lastVal[1], + ); result = second?.cacheReset ? true : result; }