From ff051569ca4b76c16af9a42408f45dea36da28b3 Mon Sep 17 00:00:00 2001 From: pcjones Date: Fri, 23 Feb 2024 14:08:56 +0100 Subject: [PATCH] Fix separator being added twice --- UmlautAdaptarr/Services/TitleMatchingService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UmlautAdaptarr/Services/TitleMatchingService.cs b/UmlautAdaptarr/Services/TitleMatchingService.cs index 0eab296..8c35111 100644 --- a/UmlautAdaptarr/Services/TitleMatchingService.cs +++ b/UmlautAdaptarr/Services/TitleMatchingService.cs @@ -221,7 +221,7 @@ namespace UmlautAdaptarr.Services */ // Construct the new title with the original suffix - var newTitle = newTitlePrefix + (string.IsNullOrEmpty(suffix) ? "" : separator + suffix); + var newTitle = newTitlePrefix + (string.IsNullOrEmpty(suffix) ? "" : suffix.StartsWith(separator) ? suffix : $"{separator}{suffix}"); // Update the title element's value with the new title //titleElement.Value = newTitle + $"({originalTitle.Substring(0, variationLength)})";