From 2ae236b68cef3f0cb40aae730ea021e468a366ae Mon Sep 17 00:00:00 2001 From: pcjones Date: Tue, 13 Feb 2024 01:38:06 +0100 Subject: [PATCH] Add Lidarr album matching workaround --- UmlautAdaptarr/Services/TitleMatchingService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/UmlautAdaptarr/Services/TitleMatchingService.cs b/UmlautAdaptarr/Services/TitleMatchingService.cs index c797bd2..b392896 100644 --- a/UmlautAdaptarr/Services/TitleMatchingService.cs +++ b/UmlautAdaptarr/Services/TitleMatchingService.cs @@ -74,7 +74,8 @@ namespace UmlautAdaptarr.Services var test = originalTitle[matchEndPositionInOriginal]; // Check and adjust for immediate following delimiter - if (matchEndPositionInOriginal < originalTitle.Length && new char[] { ' ', '-', '_', '.' }.Contains(originalTitle[matchEndPositionInOriginal])) + char[] delimiters = new char[] { ' ', '-', '_', '.' }; + if (matchEndPositionInOriginal < originalTitle.Length && delimiters.Contains(originalTitle[matchEndPositionInOriginal])) { matchEndPositionInOriginal++; // Skip the delimiter if it's immediately after the match } @@ -84,7 +85,7 @@ namespace UmlautAdaptarr.Services suffix = suffix.Replace("-", "."); // Concatenate the expected title with the remaining suffix - var updatedTitle = $"{searchItem.ExpectedAuthor} - {searchItem.ExpectedTitle}-{suffix}"; + var updatedTitle = $"{searchItem.ExpectedAuthor} - {searchItem.ExpectedTitle} [] {suffix}"; // Update the title element titleElement.Value = updatedTitle;