1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

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 @@ public void should_return_empty_when_series_is_not_found()
}
[Test]
public void should_get_mapping()
[TestCase(82807)]
public void should_get_mapping(int seriesId)
{
var result = Subject.GetSceneTvdbMappings(82807);
var result = Subject.GetSceneTvdbMappings(seriesId);
result.Should().NotBeEmpty();
result.Should().OnlyContain(c => c.Scene != 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 @@ public List<XemSceneTvdbMapping> GetSceneTvdbMappings(int id)
var response = restClient.ExecuteAndValidate<XemResult<List<XemSceneTvdbMapping>>>(request);
CheckForFailureResult(response);
return response.Data;
return response.Data.Where(c => c.Scene != null).ToList();
}
private static void CheckForFailureResult<T>(XemResult<T> response)