Fixed EpisodeProvider queries with multiple terms.

SeriesProvider.FindSeries will now return the QualityProfile when a series is found.
pull/3113/head
Mark McDowall 14 years ago
parent 85d5b07c67
commit d6920ee8ea

@ -106,7 +106,6 @@ namespace NzbDrone.Core.Test
mocker.GetMock<DiskProvider>()
.Setup(e => e.GetSize(fileName)).Returns(size).Verifiable();
//Act
var result = mocker.Resolve<MediaFileProvider>().ImportFile(fakeSeries, fileName);

@ -292,7 +292,6 @@
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

@ -38,12 +38,12 @@ namespace NzbDrone.Core.Providers
public virtual Episode GetEpisode(int seriesId, int seasonNumber, int episodeNumber)
{
return _database.Single<Episode>("WHERE SeriesId = @0 AND SeasonNumber = @2 AND EpisodeNumber = @3", seriesId, seasonNumber, episodeNumber);
return _database.Single<Episode>("WHERE SeriesId = @0 AND SeasonNumber = @1 AND EpisodeNumber = @2", seriesId, seasonNumber, episodeNumber);
}
public virtual Episode GetEpisode(int seriesId, DateTime date)
{
return _database.Single<Episode>("WHERE SeriesId = @0 AND AirDate = @2", seriesId, date.Date);
return _database.Single<Episode>("WHERE SeriesId = @0 AND AirDate = @1", seriesId, date.Date);
}
public virtual IList<Episode> GetEpisodeBySeries(long seriesId)

@ -119,7 +119,15 @@ namespace NzbDrone.Core.Providers
return GetSeries(seriesId.Value);
}
return _database.FirstOrDefault<Series>("WHERE CleanTitle = @0", normalizeTitle);
var series = _database.FirstOrDefault<Series>("WHERE CleanTitle = @0", normalizeTitle);
if (series != null)
{
series.QualityProfile = _qualityProvider.Get(series.QualityProfileId);
return series;
}
return null;
}
public virtual void UpdateSeries(Series series)

Loading…
Cancel
Save