mirror of
https://github.com/Readarr/Readarr
synced 2026-02-11 17:23:26 +01:00
Fixed: Abort if calibre detects duplicate
This commit is contained in:
parent
b3aeeeef09
commit
400bc5f8bb
1 changed files with 8 additions and 1 deletions
|
|
@ -72,7 +72,14 @@ public CalibreImportJob AddBook(BookFile book, CalibreSettings settings)
|
|||
var request = builder.Build();
|
||||
request.SetContent(body);
|
||||
|
||||
return _httpClient.Post<CalibreImportJob>(request).Resource;
|
||||
var response = _httpClient.Post<CalibreImportJob>(request).Resource;
|
||||
|
||||
if (response.Id == 0)
|
||||
{
|
||||
throw new CalibreException("Calibre rejected duplicate book");
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
catch (HttpException ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue