mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-04-20 20:00:48 +02:00
Fixed: (Nebulance) Searching for daily episodes using ids
This commit is contained in:
parent
9d1384792a
commit
b0f755a30c
1 changed files with 16 additions and 3 deletions
|
|
@ -133,9 +133,15 @@ public IndexerPageableRequestChain GetSearchRequests(TvSearchCriteria searchCrit
|
|||
queryParams.Release = searchQuery;
|
||||
}
|
||||
|
||||
if (DateTime.TryParseExact($"{searchCriteria.Season} {searchCriteria.Episode}", "yyyy MM/dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var showDate))
|
||||
if (searchCriteria.Season.HasValue &&
|
||||
searchCriteria.Episode.IsNotNullOrWhiteSpace() &&
|
||||
DateTime.TryParseExact($"{searchCriteria.Season} {searchCriteria.Episode}", "yyyy MM/dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var showDate))
|
||||
{
|
||||
queryParams.Name = searchQuery;
|
||||
if (searchQuery.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
queryParams.Name = searchQuery;
|
||||
}
|
||||
|
||||
queryParams.Release = showDate.ToString("yyyy.MM.dd", CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
|
|
@ -162,7 +168,7 @@ public IndexerPageableRequestChain GetSearchRequests(TvSearchCriteria searchCrit
|
|||
return new IndexerPageableRequestChain();
|
||||
}
|
||||
|
||||
if (queryParams.Name is { Length: < 3 } || queryParams.Release is { Length: < 3 })
|
||||
if (queryParams.Name is { Length: > 0 and < 3 } || queryParams.Release is { Length: > 0 and < 3 })
|
||||
{
|
||||
_logger.Debug("NBL API does not support release calls that are 2 characters or fewer.");
|
||||
|
||||
|
|
@ -195,6 +201,13 @@ public IndexerPageableRequestChain GetSearchRequests(BasicSearchCriteria searchC
|
|||
queryParams.Release = searchQuery;
|
||||
}
|
||||
|
||||
if (queryParams.Release is { Length: > 0 and < 3 })
|
||||
{
|
||||
_logger.Debug("NBL API does not support release calls that are 2 characters or fewer.");
|
||||
|
||||
return new IndexerPageableRequestChain();
|
||||
}
|
||||
|
||||
pageableRequests.Add(GetPagedRequests(queryParams, searchCriteria.Limit, searchCriteria.Offset));
|
||||
|
||||
return pageableRequests;
|
||||
|
|
|
|||
Loading…
Reference in a new issue