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.
This commit is contained in:
Felix 2026-05-05 21:55:23 +03:00
parent 5e551b2746
commit 5829c65426

View File

@ -334,12 +334,9 @@ namespace LME.JackTor
if (!IsCodecAllowed(codec)) if (!IsCodecAllowed(codec))
continue; continue;
if (serial != 1)
{
int extractedYear = ExtractYear(searchable); int extractedYear = ExtractYear(searchable);
if (year > 1900 && extractedYear > 1900 && Math.Abs(extractedYear - year) > yearTolerance) if (serial != 1 && year > 1900 && extractedYear > 1900 && Math.Abs(extractedYear - year) > yearTolerance)
continue; continue;
}
int[] seasons = ParseSeasons(searchable); int[] seasons = ParseSeasons(searchable);
bool serialHint = IsSerialHint(searchable); bool serialHint = IsSerialHint(searchable);