mirror of https://github.com/lidarr/Lidarr
SeriesProvider.GetSeries(int seriesId) will now fail if series is not found.
This commit is contained in:
parent
5c055ebb9a
commit
a990fb91d5
|
@ -106,6 +106,7 @@ namespace NzbDrone.Core.Test
|
||||||
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
[ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Sequence contains no elements")]
|
||||||
public void Get_series_invalid_series_id_should_return_null()
|
public void Get_series_invalid_series_id_should_return_null()
|
||||||
{
|
{
|
||||||
var mocker = new AutoMoqer();
|
var mocker = new AutoMoqer();
|
||||||
|
|
|
@ -44,11 +44,9 @@ namespace NzbDrone.Core.Providers
|
||||||
|
|
||||||
public virtual Series GetSeries(int seriesId)
|
public virtual Series GetSeries(int seriesId)
|
||||||
{
|
{
|
||||||
var series = _database.SingleOrDefault<Series>("WHERE seriesId= @0", seriesId);
|
var series = _database.Single<Series>("WHERE seriesId= @0", seriesId);
|
||||||
if (series != null)
|
series.QualityProfile = _qualityProvider.Get(series.QualityProfileId);
|
||||||
{
|
|
||||||
series.QualityProfile = _qualityProvider.Get(series.QualityProfileId);
|
|
||||||
}
|
|
||||||
return series;
|
return series;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue