From 5829c6542664d37bd47731545f5ff403841d14a2 Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 5 May 2026 21:55:23 +0300 Subject: [PATCH] refactor(jacktor): simplify year validation logic in search filtering Extract year extraction before conditional check and combine conditions into a single if statement. This improves readability without changing the filtering behavior. --- LME.JackTor/JackTorInvoke.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/LME.JackTor/JackTorInvoke.cs b/LME.JackTor/JackTorInvoke.cs index 5e5e3a2..ce8ad85 100644 --- a/LME.JackTor/JackTorInvoke.cs +++ b/LME.JackTor/JackTorInvoke.cs @@ -334,12 +334,9 @@ namespace LME.JackTor if (!IsCodecAllowed(codec)) continue; - if (serial != 1) - { - int extractedYear = ExtractYear(searchable); - if (year > 1900 && extractedYear > 1900 && Math.Abs(extractedYear - year) > yearTolerance) - continue; - } + int extractedYear = ExtractYear(searchable); + if (serial != 1 && year > 1900 && extractedYear > 1900 && Math.Abs(extractedYear - year) > yearTolerance) + continue; int[] seasons = ParseSeasons(searchable); bool serialHint = IsSerialHint(searchable);