9 Commits

Author SHA1 Message Date
pcjones
2370153192 Clarify error message on indexer request error 2026-02-01 17:51:47 +01:00
pcjones
79ad4f9370 Merge branch 'master' into develop 2026-02-01 17:49:30 +01:00
pcjones
d70ae41951 v0.7.5 (#82)
* Add newzbay categories; add title lookup API

* Update dependencies

* Update docker compose

* Fix title lookup colon workaround

* Remove rid and tmdbid from text search queries
2025-11-18 11:01:15 +01:00
PCJones
2650d32ae2 Remove rid and tmdbid from text search queries 2025-11-18 10:56:05 +01:00
PCJones
5f87a596fb Fix title lookup colon workaround 2025-11-18 10:55:51 +01:00
PCJones
c2b200f3be Update docker compose 2025-11-18 10:55:25 +01:00
PCJones
6ef8cc3cd1 Merge branch 'master' into develop
Resolved conflict in TitleLookupController.cs by keeping the master version with colon handling fix.
This brings develop up to date with master (v0.7.4), including the November bug fixes.
2025-11-18 10:49:49 +01:00
PCJones
02cf2854e1 Update dependencies 2025-07-22 16:32:31 +02:00
PCJones
22ecdaa6cd Add newzbay categories; add title lookup API 2025-07-22 16:30:30 +02:00
5 changed files with 42 additions and 6 deletions

View File

@@ -56,6 +56,8 @@ namespace UmlautAdaptarr.Controllers
queryParameters.Remove("tvdbid");
queryParameters.Remove("tvmazeid");
queryParameters.Remove("imdbid");
queryParameters.Remove("rid");
queryParameters.Remove("tmdbid");
var titleSearchVariations = new List<string>(searchItem?.TitleSearchVariations);

View File

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

View File

@@ -202,6 +202,13 @@ namespace UmlautAdaptarr.Services
var key = $"{TitleRenamePrefix}{changedTitle.Trim().ToLowerInvariant()}";
cache.Set(key, originalTitle, TitleRenameCacheDuration);
// If title contains ":" also add it as "-" for arr/sabnzbd compatibility
if (changedTitle.Contains(':'))
{
var altKey = $"{TitleRenamePrefix}{changedTitle.Replace(':', '-').Trim().ToLowerInvariant()}";
cache.Set(altKey, originalTitle, TitleRenameCacheDuration);
}
}
public string? GetOriginalTitleFromRenamed(string changedTitle)

View File

@@ -54,6 +54,7 @@ namespace UmlautAdaptarr.Services
}
await EnsureMinimumDelayAsync(targetUri);
var targetHost = new Uri(targetUri).Host;
var requestMessage = new HttpRequestMessage
{
@@ -88,7 +89,14 @@ namespace UmlautAdaptarr.Services
}
catch (Exception ex)
{
_logger.LogError(ex, $"Error proxying request: {UrlUtilities.RedactApiKey(targetUri)}. Error: {ex.Message}");
var upstreamMessage = IsTimeoutOrReset(ex)
? $"{targetHost} timed out or reset the connection. This is an error with your indexer or network, not with UmlautAdaptarr."
: $"{targetHost} request failed. This is an error with your indexer or network, not with UmlautAdaptarr.";
_logger.LogError(ex, "{UpstreamMessage} Target: {TargetUri} Error: {ErrorMessage}",
upstreamMessage,
UrlUtilities.RedactApiKey(targetUri),
ex.Message);
var errorResponse = new HttpResponseMessage(System.Net.HttpStatusCode.InternalServerError)
{
@@ -97,5 +105,26 @@ namespace UmlautAdaptarr.Services
return errorResponse;
}
}
private static bool IsTimeoutOrReset(Exception ex)
{
if (ex is TaskCanceledException)
{
return true;
}
var current = ex;
while (current != null)
{
if (current is System.Net.Sockets.SocketException socketEx)
{
return socketEx.SocketErrorCode == System.Net.Sockets.SocketError.TimedOut
|| socketEx.SocketErrorCode == System.Net.Sockets.SocketError.ConnectionReset;
}
current = current.InnerException;
}
return false;
}
}
}

View File

@@ -34,9 +34,9 @@ services:
#- SONARR__1__APIKEY=APIKEY
### Advanced options (with default values))
#- IpLeakTest__Enabled=false
#- SETTINGS__EnableChangedTitleCache=false # Enables the changed title API under /titlelookup?changedTitle=$title - enable if you are using crowdnfo.net post processing script.
#- SETTINGS__IndexerRequestsCacheDurationInMinutes=12 # How long to cache indexer requests for. Default is 12 minutes.
#- SETTINGS__ApiKey= # API key for requests to the UmlautAdaptarr. Optional, probably only needed for seedboxes.
#- SETTINGS__ProxyPort=5006 # Proxy port for the internal UmlautAdaptarr proxy used for Prowlarr.
#- Kestrel__Endpoints__Http__Url=http://[::]:5005 # HTTP port for the UmlautAdaptarr
#- IpLeakTest__Enabled=false