diff --git a/src/NzbDrone.Core.Test/ImportListTests/ImportListSyncServiceFixture.cs b/src/NzbDrone.Core.Test/ImportListTests/ImportListSyncServiceFixture.cs index 213e813cb..ac83a2f72 100644 --- a/src/NzbDrone.Core.Test/ImportListTests/ImportListSyncServiceFixture.cs +++ b/src/NzbDrone.Core.Test/ImportListTests/ImportListSyncServiceFixture.cs @@ -105,7 +105,7 @@ namespace NzbDrone.Core.Test.ImportListTests Subject.Execute(new ImportListSyncCommand()); Mocker.GetMock() - .Verify(v => v.AddSeries(It.Is>(t=>t.Count == 0))); + .Verify(v => v.AddSeries(It.Is>(t=>t.Count == 0), It.IsAny())); } [TestCase(MonitorTypes.None, false)] @@ -118,7 +118,7 @@ namespace NzbDrone.Core.Test.ImportListTests Subject.Execute(new ImportListSyncCommand()); Mocker.GetMock() - .Verify(v => v.AddSeries(It.Is>(t => t.Count == 1 && t.First().Monitored == expectedSeriesMonitored))); + .Verify(v => v.AddSeries(It.Is>(t => t.Count == 1 && t.First().Monitored == expectedSeriesMonitored), It.IsAny())); } [Test] @@ -130,7 +130,7 @@ namespace NzbDrone.Core.Test.ImportListTests Subject.Execute(new ImportListSyncCommand()); Mocker.GetMock() - .Verify(v => v.AddSeries(It.Is>(t => t.Count == 0))); + .Verify(v => v.AddSeries(It.Is>(t => t.Count == 0), It.IsAny())); } } } diff --git a/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs b/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs index 8b4d8b544..e5d83a351 100644 --- a/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs +++ b/src/NzbDrone.Core/ImportLists/ImportListSyncService.cs @@ -136,7 +136,7 @@ namespace NzbDrone.Core.ImportLists } } - _addSeriesService.AddSeries(seriesToAdd); + _addSeriesService.AddSeries(seriesToAdd, true); var message = string.Format("Import List Sync Completed. Items found: {0}, Series added: {1}", reports.Count, seriesToAdd.Count); diff --git a/src/NzbDrone.Core/Tv/AddSeriesService.cs b/src/NzbDrone.Core/Tv/AddSeriesService.cs index d82497e27..8c77748ea 100644 --- a/src/NzbDrone.Core/Tv/AddSeriesService.cs +++ b/src/NzbDrone.Core/Tv/AddSeriesService.cs @@ -16,7 +16,7 @@ namespace NzbDrone.Core.Tv public interface IAddSeriesService { Series AddSeries(Series newSeries); - List AddSeries(List newSeries); + List AddSeries(List newSeries, bool ignoreErrors = false); } public class AddSeriesService : IAddSeriesService @@ -53,18 +53,29 @@ namespace NzbDrone.Core.Tv return newSeries; } - public List AddSeries(List newSeries) + public List AddSeries(List newSeries, bool ignoreErrors = false) { var added = DateTime.UtcNow; var seriesToAdd = new List(); foreach (var s in newSeries) { - // TODO: Verify if adding skyhook data will be slow - var series = AddSkyhookData(s); - series = SetPropertiesAndValidate(series); - series.Added = added; - seriesToAdd.Add(series); + try + { + var series = AddSkyhookData(s); + series = SetPropertiesAndValidate(series); + series.Added = added; + seriesToAdd.Add(series); + } + catch (ValidationException ex) + { + if (!ignoreErrors) + { + throw; + } + + _logger.Debug("tvdbid {0} was not added due to validation failures. {1}", s.TvdbId, ex.Message); + } } return _seriesService.AddSeries(seriesToAdd);