From 5c055ebb9aa65b87f2e785899d3c1196ab1d064e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 18 Jun 2011 16:03:58 -0700 Subject: [PATCH] Reverted back to Single instead of SingleOrDefault except when searching for an episode in DB. --- NzbDrone.Core/Providers/EpisodeProvider.cs | 2 +- NzbDrone.Core/Providers/IndexerProvider.cs | 2 +- NzbDrone.Core/Providers/MediaFileProvider.cs | 2 +- NzbDrone.Core/Providers/QualityProvider.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NzbDrone.Core/Providers/EpisodeProvider.cs b/NzbDrone.Core/Providers/EpisodeProvider.cs index 248b8e739..cf065a301 100644 --- a/NzbDrone.Core/Providers/EpisodeProvider.cs +++ b/NzbDrone.Core/Providers/EpisodeProvider.cs @@ -34,7 +34,7 @@ public virtual void AddEpisode(Episode episode) public virtual Episode GetEpisode(long id) { - return _database.SingleOrDefault(id); + return _database.Single(id); } public virtual Episode GetEpisode(int seriesId, int seasonNumber, int episodeNumber) diff --git a/NzbDrone.Core/Providers/IndexerProvider.cs b/NzbDrone.Core/Providers/IndexerProvider.cs index 292a37027..48ad40431 100644 --- a/NzbDrone.Core/Providers/IndexerProvider.cs +++ b/NzbDrone.Core/Providers/IndexerProvider.cs @@ -54,7 +54,7 @@ public virtual void SaveSettings(IndexerSetting settings) public virtual IndexerSetting GetSettings(Type type) { - return _database.SingleOrDefault("WHERE IndexProviderType = @0", type.ToString()); + return _database.Single("WHERE IndexProviderType = @0", type.ToString()); } public virtual void InitializeIndexers(IList indexers) diff --git a/NzbDrone.Core/Providers/MediaFileProvider.cs b/NzbDrone.Core/Providers/MediaFileProvider.cs index fe15eedb5..8b2c39aad 100644 --- a/NzbDrone.Core/Providers/MediaFileProvider.cs +++ b/NzbDrone.Core/Providers/MediaFileProvider.cs @@ -196,7 +196,7 @@ public virtual void Update(EpisodeFile episodeFile) public virtual EpisodeFile GetEpisodeFile(int episodeFileId) { - return _database.SingleOrDefault(episodeFileId); + return _database.Single(episodeFileId); } public virtual List GetEpisodeFiles() diff --git a/NzbDrone.Core/Providers/QualityProvider.cs b/NzbDrone.Core/Providers/QualityProvider.cs index 53529c5ef..fc9fd5353 100644 --- a/NzbDrone.Core/Providers/QualityProvider.cs +++ b/NzbDrone.Core/Providers/QualityProvider.cs @@ -53,7 +53,7 @@ public virtual List GetAllProfiles() public virtual QualityProfile Get(int profileId) { - return _database.SingleOrDefault(profileId); + return _database.Single(profileId); } public virtual void SetupDefaultProfiles()