Specify in the logs what indexer is lacking capabilities

This commit is contained in:
Bogdan 2023-08-10 02:48:06 +03:00 committed by GitHub
parent 322836e2b3
commit 51dc96cb6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 8 deletions

View File

@ -3,6 +3,7 @@ using System.Linq;
using FluentAssertions; using FluentAssertions;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Newznab; using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Test.Framework;
@ -19,6 +20,11 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
[SetUp] [SetUp]
public void SetUp() public void SetUp()
{ {
Subject.Definition = new IndexerDefinition
{
Name = "Newznab"
};
Subject.Settings = new NewznabSettings() Subject.Settings = new NewznabSettings()
{ {
BaseUrl = "http://127.0.0.1:1234/", BaseUrl = "http://127.0.0.1:1234/",

View File

@ -31,6 +31,7 @@ namespace NzbDrone.Core.Indexers.Newznab
{ {
return new NewznabRequestGenerator(_capabilitiesProvider) return new NewznabRequestGenerator(_capabilitiesProvider)
{ {
Definition = Definition,
PageSize = PageSize, PageSize = PageSize,
Settings = Settings Settings = Settings
}; };

View File

@ -7,6 +7,7 @@ using NzbDrone.Common.Http;
using NzbDrone.Common.Instrumentation; using NzbDrone.Common.Instrumentation;
using NzbDrone.Core.DataAugmentation.Scene; using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Core.Indexers.Newznab namespace NzbDrone.Core.Indexers.Newznab
{ {
@ -15,6 +16,7 @@ namespace NzbDrone.Core.Indexers.Newznab
private readonly Logger _logger; private readonly Logger _logger;
private readonly INewznabCapabilitiesProvider _capabilitiesProvider; private readonly INewznabCapabilitiesProvider _capabilitiesProvider;
public ProviderDefinition Definition { get; set; }
public int MaxPages { get; set; } public int MaxPages { get; set; }
public int PageSize { get; set; } public int PageSize { get; set; }
public NewznabSettings Settings { get; set; } public NewznabSettings Settings { get; set; }
@ -203,14 +205,14 @@ namespace NzbDrone.Core.Indexers.Newznab
if (!SupportsEpisodeSearch) if (!SupportsEpisodeSearch)
{ {
_logger.Debug("Indexer capabilities lacking season & ep query parameters, no Standard series search possible."); _logger.Debug("Indexer capabilities lacking season & ep query parameters, no Standard series search possible: {0}", Definition.Name);
return pageableRequests; return pageableRequests;
} }
if (!SupportsTvTextSearches && !SupportsTvIdSearches) if (!SupportsTvTextSearches && !SupportsTvIdSearches)
{ {
_logger.Debug("Indexer capabilities lacking q, title, tvdbid, imdbid, rid and tvmazeid parameters, no Standard series search possible."); _logger.Debug("Indexer capabilities lacking q, title, tvdbid, imdbid, rid and tvmazeid parameters, no Standard series search possible: {0}", Definition.Name);
return pageableRequests; return pageableRequests;
} }
@ -250,14 +252,14 @@ namespace NzbDrone.Core.Indexers.Newznab
if (!SupportsSeasonSearch) if (!SupportsSeasonSearch)
{ {
_logger.Debug("Indexer capabilities lacking season query parameter, no Standard series search possible."); _logger.Debug("Indexer capabilities lacking season query parameter, no Standard series search possible: {0}", Definition.Name);
return pageableRequests; return pageableRequests;
} }
if (!SupportsTvTextSearches && !SupportsTvIdSearches) if (!SupportsTvTextSearches && !SupportsTvIdSearches)
{ {
_logger.Debug("Indexer capabilities lacking q, title, tvdbid, imdbid, rid and tvmazeid parameters, no Standard series search possible."); _logger.Debug("Indexer capabilities lacking q, title, tvdbid, imdbid, rid and tvmazeid parameters, no Standard series search possible: {0}", Definition.Name);
return pageableRequests; return pageableRequests;
} }
@ -297,14 +299,14 @@ namespace NzbDrone.Core.Indexers.Newznab
if (!SupportsEpisodeSearch) if (!SupportsEpisodeSearch)
{ {
_logger.Debug("Indexer capabilities lacking season & ep query parameters, no Daily series search possible."); _logger.Debug("Indexer capabilities lacking season & ep query parameters, no Daily series search possible: {0}", Definition.Name);
return pageableRequests; return pageableRequests;
} }
if (!SupportsTvTextSearches && !SupportsTvIdSearches) if (!SupportsTvTextSearches && !SupportsTvIdSearches)
{ {
_logger.Debug("Indexer capabilities lacking q, title, tvdbid, imdbid, rid and tvmazeid parameters, no Daily series search possible."); _logger.Debug("Indexer capabilities lacking q, title, tvdbid, imdbid, rid and tvmazeid parameters, no Daily series search possible: {0}", Definition.Name);
return pageableRequests; return pageableRequests;
} }
@ -344,14 +346,14 @@ namespace NzbDrone.Core.Indexers.Newznab
if (!SupportsEpisodeSearch) if (!SupportsEpisodeSearch)
{ {
_logger.Debug("Indexer capabilities lacking season query parameter, no Daily series search possible."); _logger.Debug("Indexer capabilities lacking season query parameter, no Daily series search possible: {0}", Definition.Name);
return pageableRequests; return pageableRequests;
} }
if (!SupportsTvTextSearches && !SupportsTvIdSearches) if (!SupportsTvTextSearches && !SupportsTvIdSearches)
{ {
_logger.Debug("Indexer capabilities lacking q, title, tvdbid, imdbid, rid and tvmazeid parameters, no Daily series search possible."); _logger.Debug("Indexer capabilities lacking q, title, tvdbid, imdbid, rid and tvmazeid parameters, no Daily series search possible: {0}", Definition.Name);
return pageableRequests; return pageableRequests;
} }

View File

@ -32,6 +32,7 @@ namespace NzbDrone.Core.Indexers.Torznab
{ {
return new NewznabRequestGenerator(_capabilitiesProvider) return new NewznabRequestGenerator(_capabilitiesProvider)
{ {
Definition = Definition,
PageSize = PageSize, PageSize = PageSize,
Settings = Settings Settings = Settings
}; };