Fixed: Import list import error

pull/395/head
ta264 4 years ago
parent 515751b1e1
commit 220808a7c4

@ -43,6 +43,7 @@ namespace NzbDrone.Core.Test.ImportListTests
.Returns<int>(x => Builder<Book> .Returns<int>(x => Builder<Book>
.CreateListOfSize(1) .CreateListOfSize(1)
.TheFirst(1) .TheFirst(1)
.With(b => b.ForeignBookId = "4321")
.With(b => b.Editions = Builder<Edition> .With(b => b.Editions = Builder<Edition>
.CreateListOfSize(1) .CreateListOfSize(1)
.TheFirst(1) .TheFirst(1)
@ -84,7 +85,7 @@ namespace NzbDrone.Core.Test.ImportListTests
private void WithBookId() private void WithBookId()
{ {
_importListReports.First().EditionGoodreadsId = "101"; _importListReports.First().EditionGoodreadsId = "1234";
} }
private void WithExistingArtist() private void WithExistingArtist()
@ -122,7 +123,7 @@ namespace NzbDrone.Core.Test.ImportListTests
{ {
new ImportListExclusion new ImportListExclusion
{ {
ForeignId = "101" ForeignId = "4321"
} }
}); });
} }

@ -172,7 +172,7 @@ namespace NzbDrone.Core.ImportLists
} }
// Check to see if book in DB // Check to see if book in DB
var existingAlbum = _bookService.FindById(report.EditionGoodreadsId); var existingAlbum = _bookService.FindById(report.BookGoodreadsId);
if (existingAlbum != null) if (existingAlbum != null)
{ {
@ -181,7 +181,7 @@ namespace NzbDrone.Core.ImportLists
} }
// Check to see if book excluded // Check to see if book excluded
var excludedAlbum = listExclusions.SingleOrDefault(s => s.ForeignId == report.EditionGoodreadsId); var excludedAlbum = listExclusions.SingleOrDefault(s => s.ForeignId == report.BookGoodreadsId);
if (excludedAlbum != null) if (excludedAlbum != null)
{ {
@ -199,7 +199,7 @@ namespace NzbDrone.Core.ImportLists
} }
// Append Album if not already in DB or already on add list // Append Album if not already in DB or already on add list
if (albumsToAdd.All(s => s.ForeignBookId != report.EditionGoodreadsId)) if (albumsToAdd.All(s => s.ForeignBookId != report.BookGoodreadsId))
{ {
var monitored = importList.ShouldMonitor != ImportListMonitorType.None; var monitored = importList.ShouldMonitor != ImportListMonitorType.None;

Loading…
Cancel
Save