Fixed: xem mappings for series without scene mapping

This commit is contained in:
kayone 2013-11-26 23:48:28 -08:00
parent 7efac124c7
commit 0069b29f88
2 changed files with 13 additions and 4 deletions

View File

@ -46,14 +46,23 @@ namespace NzbDrone.Core.Test.Providers
} }
[Test] [TestCase(82807)]
public void should_get_mapping() public void should_get_mapping(int seriesId)
{ {
var result = Subject.GetSceneTvdbMappings(82807); var result = Subject.GetSceneTvdbMappings(seriesId);
result.Should().NotBeEmpty(); result.Should().NotBeEmpty();
result.Should().OnlyContain(c => c.Scene != null); result.Should().OnlyContain(c => c.Scene != null);
result.Should().OnlyContain(c => c.Tvdb != null); result.Should().OnlyContain(c => c.Tvdb != null);
} }
[TestCase(78916)]
public void should_filter_out_episodes_without_scene_mapping(int seriesId)
{
var result = Subject.GetSceneTvdbMappings(seriesId);
result.Should().NotContain(c => c.Tvdb == null);
}
} }
} }

View File

@ -61,7 +61,7 @@ namespace NzbDrone.Core.DataAugmentation.Xem
var response = restClient.ExecuteAndValidate<XemResult<List<XemSceneTvdbMapping>>>(request); var response = restClient.ExecuteAndValidate<XemResult<List<XemSceneTvdbMapping>>>(request);
CheckForFailureResult(response); CheckForFailureResult(response);
return response.Data; return response.Data.Where(c => c.Scene != null).ToList();
} }
private static void CheckForFailureResult<T>(XemResult<T> response) private static void CheckForFailureResult<T>(XemResult<T> response)