mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-27 23:16:58 -04:00
Fixed: (AvistaZ) Allow search by episode
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Indexers.Definitions.Avistaz;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.Definitions
|
||||
@@ -23,6 +25,18 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
{
|
||||
}
|
||||
|
||||
public override IIndexerRequestGenerator GetRequestGenerator()
|
||||
{
|
||||
return new AvistaZRequestGenerator
|
||||
{
|
||||
Settings = Settings,
|
||||
Capabilities = Capabilities,
|
||||
PageSize = PageSize,
|
||||
HttpClient = _httpClient,
|
||||
Logger = _logger
|
||||
};
|
||||
}
|
||||
|
||||
public override IParseIndexerResponse GetParser()
|
||||
{
|
||||
return new AvistaZParser();
|
||||
@@ -57,6 +71,17 @@ namespace NzbDrone.Core.Indexers.Definitions
|
||||
}
|
||||
}
|
||||
|
||||
public class AvistaZRequestGenerator : AvistazRequestGenerator
|
||||
{
|
||||
// AvistaZ has episodes without season. eg Running Man E323
|
||||
protected override string GetEpisodeSearchTerm(TvSearchCriteria searchCriteria)
|
||||
{
|
||||
return searchCriteria.Season is null or 0 && searchCriteria.Episode.IsNotNullOrWhiteSpace()
|
||||
? $"E{searchCriteria.Episode}"
|
||||
: $"{searchCriteria.EpisodeSearchString}";
|
||||
}
|
||||
}
|
||||
|
||||
public class AvistaZParser : AvistazParserBase
|
||||
{
|
||||
protected override string TimezoneOffset => "+02:00";
|
||||
|
||||
Reference in New Issue
Block a user