mirror of
https://github.com/Readarr/Readarr
synced 2025-12-16 05:12:42 +01:00
parent
1e0e8adc77
commit
acb6fc01b3
2 changed files with 44 additions and 3 deletions
|
|
@ -0,0 +1,41 @@
|
|||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.MediaFiles.BookImport.Identification;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
using NzbDrone.Core.MetadataSource.Goodreads;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.MediaFiles.BookImport.Identification
|
||||
{
|
||||
[TestFixture]
|
||||
public class CandidateServiceFixture : CoreTest<CandidateService>
|
||||
{
|
||||
[Test]
|
||||
public void should_not_throw_on_goodreads_exception()
|
||||
{
|
||||
Mocker.GetMock<ISearchForNewBook>()
|
||||
.Setup(s => s.SearchForNewBook(It.IsAny<string>(), It.IsAny<string>()))
|
||||
.Throws(new GoodreadsException("Bad search"));
|
||||
|
||||
var edition = new LocalEdition
|
||||
{
|
||||
LocalBooks = new List<LocalBook>
|
||||
{
|
||||
new LocalBook
|
||||
{
|
||||
FileTrackInfo = new ParsedTrackInfo
|
||||
{
|
||||
AuthorTitle = "Author",
|
||||
BookTitle = "Book"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Subject.GetRemoteCandidates(edition).Should().BeEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Books;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
using NzbDrone.Core.MetadataSource.SkyHook;
|
||||
using NzbDrone.Core.MetadataSource.Goodreads;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.MediaFiles.BookImport.Identification
|
||||
|
|
@ -258,9 +258,9 @@ public List<CandidateEdition> GetRemoteCandidates(LocalEdition localEdition)
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (SkyHookException e)
|
||||
catch (GoodreadsException e)
|
||||
{
|
||||
_logger.Info(e, "Skipping book due to SkyHook error");
|
||||
_logger.Info(e, "Skipping book due to Goodreads error");
|
||||
remoteBooks = new List<Book>();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue