mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-01-26 17:42:31 +01:00
Fixed: (API) Log errors in Newznab response
This commit is contained in:
parent
451f60319f
commit
ea24a81ef7
1 changed files with 19 additions and 13 deletions
|
|
@ -9,6 +9,7 @@
|
|||
using Microsoft.AspNetCore.Cors;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Download;
|
||||
|
|
@ -34,13 +35,15 @@ public class NewznabController : Controller
|
|||
private IIndexerStatusService _indexerStatusService;
|
||||
private IDownloadMappingService _downloadMappingService { get; set; }
|
||||
private IDownloadService _downloadService { get; set; }
|
||||
private readonly Logger _logger;
|
||||
|
||||
public NewznabController(IndexerFactory indexerFactory,
|
||||
ISearchForNzb nzbSearchService,
|
||||
IIndexerLimitService indexerLimitService,
|
||||
IIndexerStatusService indexerStatusService,
|
||||
IDownloadMappingService downloadMappingService,
|
||||
IDownloadService downloadService)
|
||||
IDownloadService downloadService,
|
||||
Logger logger)
|
||||
{
|
||||
_indexerFactory = indexerFactory;
|
||||
_nzbSearchService = nzbSearchService;
|
||||
|
|
@ -48,6 +51,7 @@ public NewznabController(IndexerFactory indexerFactory,
|
|||
_indexerStatusService = indexerStatusService;
|
||||
_downloadMappingService = downloadMappingService;
|
||||
_downloadService = downloadService;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpGet("/api/v1/indexer/{id:int}/newznab")]
|
||||
|
|
@ -82,21 +86,21 @@ public async Task<IActionResult> GetNewznabResponse(int id, [FromQuery] NewznabR
|
|||
var caps = new IndexerCapabilities
|
||||
{
|
||||
TvSearchParams = new List<TvSearchParam>
|
||||
{
|
||||
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep
|
||||
},
|
||||
{
|
||||
TvSearchParam.Q, TvSearchParam.Season, TvSearchParam.Ep
|
||||
},
|
||||
MovieSearchParams = new List<MovieSearchParam>
|
||||
{
|
||||
MovieSearchParam.Q
|
||||
},
|
||||
{
|
||||
MovieSearchParam.Q
|
||||
},
|
||||
MusicSearchParams = new List<MusicSearchParam>
|
||||
{
|
||||
MusicSearchParam.Q
|
||||
},
|
||||
{
|
||||
MusicSearchParam.Q
|
||||
},
|
||||
BookSearchParams = new List<BookSearchParam>
|
||||
{
|
||||
BookSearchParam.Q
|
||||
}
|
||||
{
|
||||
BookSearchParam.Q
|
||||
}
|
||||
};
|
||||
|
||||
foreach (var cat in NewznabStandardCategory.AllCats)
|
||||
|
|
@ -263,6 +267,8 @@ public async Task<object> GetDownload(int id, string link, string file)
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex);
|
||||
|
||||
return CreateResponse(CreateErrorXML(500, ex.Message), statusCode: StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue