Fix releases with ":" not working in title lookup API

This commit is contained in:
pcjones
2025-11-16 19:35:42 +01:00
parent c48db39d04
commit feae0ca309
2 changed files with 5 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ namespace UmlautAdaptarr.Controllers
// TODO evaluate if this should be set to true by default
private readonly bool TODO_FORCE_TEXT_SEARCH_ORIGINAL_TITLE = true;
private readonly bool TODO_FORCE_TEXT_SEARCH_GERMAN_TITLE = false;
protected async Task<IActionResult> BaseSearch(string apiKey,
protected async Task<IActionResult?> BaseSearch(string apiKey,
string domain,
IDictionary<string, string> queryParameters,
SearchItem? searchItem = null)
@@ -30,8 +30,7 @@ namespace UmlautAdaptarr.Controllers
return NotFound($"{domain} is not a valid URL.");
}
ContentResult? initialSearchResult = await PerformSingleSearchRequest(domain, queryParameters) as ContentResult;
if (initialSearchResult == null)
if (await PerformSingleSearchRequest(domain, queryParameters) is not ContentResult initialSearchResult)
{
return null;
}

View File

@@ -21,7 +21,9 @@ namespace UmlautAdaptarr.Controllers
if (string.IsNullOrWhiteSpace(changedTitle))
return BadRequest("changedTitle is required.");
var originalTitle = cacheService.GetOriginalTitleFromRenamed(changedTitle);
var cleanChangedTitle = changedTitle.Replace(":", "-");
var originalTitle = cacheService.GetOriginalTitleFromRenamed(cleanChangedTitle);
return originalTitle != null
? Ok(new { changedTitle, originalTitle })