From d6ba6bbfd1f1429b174aa0d212a89af817e1595d Mon Sep 17 00:00:00 2001 From: Qstick Date: Tue, 18 Jan 2022 18:35:10 -0600 Subject: [PATCH] Fixed: Parse endpoint response when title failed to parse Fixes #1175 Co-Authored-By: Taloth --- src/Readarr.Api.V1/Parse/ParseController.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Readarr.Api.V1/Parse/ParseController.cs b/src/Readarr.Api.V1/Parse/ParseController.cs index b00bc4fc9..608b747c9 100644 --- a/src/Readarr.Api.V1/Parse/ParseController.cs +++ b/src/Readarr.Api.V1/Parse/ParseController.cs @@ -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 @@ namespace Readarr.Api.V1.Parse [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);