mirror of
https://github.com/Readarr/Readarr
synced 2025-12-15 12:52:27 +01:00
Fixed: Parse endpoint response when title failed to parse
Fixes #1175 Co-Authored-By: Taloth <Taloth@users.noreply.github.com>
This commit is contained in:
parent
de72cfcaaa
commit
d6ba6bbfd1
1 changed files with 10 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Parser;
|
||||
using Readarr.Api.V1.Author;
|
||||
using Readarr.Api.V1.Books;
|
||||
|
|
@ -19,11 +20,19 @@ public ParseController(IParsingService parsingService)
|
|||
[HttpGet]
|
||||
public ParseResource Parse(string title)
|
||||
{
|
||||
if (title.IsNullOrWhiteSpace())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var parsedBookInfo = Parser.ParseBookTitle(title);
|
||||
|
||||
if (parsedBookInfo == null)
|
||||
{
|
||||
return null;
|
||||
return new ParseResource
|
||||
{
|
||||
Title = title
|
||||
};
|
||||
}
|
||||
|
||||
var remoteBook = _parsingService.Map(parsedBookInfo);
|
||||
|
|
|
|||
Loading…
Reference in a new issue