diff --git a/NzbDrone.Core/NzbDrone.Core.csproj b/NzbDrone.Core/NzbDrone.Core.csproj
index c30073aa3..3bacbe752 100644
--- a/NzbDrone.Core/NzbDrone.Core.csproj
+++ b/NzbDrone.Core/NzbDrone.Core.csproj
@@ -140,11 +140,14 @@
+
+
+
diff --git a/NzbDrone.Core/Providers/EpisodeProvider.cs b/NzbDrone.Core/Providers/EpisodeProvider.cs
index 54a870870..1f292e219 100644
--- a/NzbDrone.Core/Providers/EpisodeProvider.cs
+++ b/NzbDrone.Core/Providers/EpisodeProvider.cs
@@ -6,7 +6,7 @@ using SubSonic.Repository;
namespace NzbDrone.Core.Providers
{
- public class EpisodeProvider
+ public class EpisodeProvider : IEpisodeProvider
{
//TODO: Remove parsing of the series name, it should be done in series provider
private static readonly Regex ParseRegex = new Regex(@"(?.*)
@@ -44,6 +44,16 @@ namespace NzbDrone.Core.Providers
throw new NotImplementedException();
}
+ public IList GetEpisodesBySeason(long seasonId)
+ {
+ throw new NotImplementedException();
+ }
+
+ public IList GetEpisodeBySeries(long seriesId)
+ {
+ throw new NotImplementedException();
+ }
+
public String GetSabTitle(Episode episode)
{
var series = _seriesProvider.GetSeries(episode.SeriesId);
@@ -59,7 +69,7 @@ namespace NzbDrone.Core.Providers
///
/// Episode that needs to be checked
///
- public bool IsEpisodeNeeded(Episode episode)
+ public bool IsNeeded(Episode episode)
{
throw new NotImplementedException();
}
diff --git a/NzbDrone.Core/Providers/IEpisodeProvider.cs b/NzbDrone.Core/Providers/IEpisodeProvider.cs
new file mode 100644
index 000000000..2ce9b962c
--- /dev/null
+++ b/NzbDrone.Core/Providers/IEpisodeProvider.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using NzbDrone.Core.Repository;
+
+namespace NzbDrone.Core.Providers
+{
+ public interface IEpisodeProvider
+ {
+ Episode GetEpisode(long id);
+ Episode SaveEpisode(Episode episode);
+ IList GetEpisodesBySeason(long seasonId);
+ IList GetEpisodeBySeries(long seriesId);
+ String GetSabTitle(Episode episode);
+
+ ///
+ /// Comprehensive check on whether or not this episode is needed.
+ ///
+ /// Episode that needs to be checked
+ ///
+ bool IsNeeded(Episode episode);
+ }
+}
\ No newline at end of file
diff --git a/NzbDrone.Core/Providers/ISeasonProvider.cs b/NzbDrone.Core/Providers/ISeasonProvider.cs
new file mode 100644
index 000000000..dfd084ec8
--- /dev/null
+++ b/NzbDrone.Core/Providers/ISeasonProvider.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+using NzbDrone.Core.Repository;
+
+namespace NzbDrone.Core.Providers
+{
+ public interface ISeasonProvider
+ {
+ Season GetSeason(long seasonId);
+ List GetSeasongs(long seriesId);
+
+ int SaveSeason(Season season);
+ }
+
+}
\ No newline at end of file
diff --git a/NzbDrone.Core/Providers/ISeriesProvider.cs b/NzbDrone.Core/Providers/ISeriesProvider.cs
index d9f51e0b8..ad1df8db4 100644
--- a/NzbDrone.Core/Providers/ISeriesProvider.cs
+++ b/NzbDrone.Core/Providers/ISeriesProvider.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Linq;
using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers
diff --git a/NzbDrone.Core/Providers/SeriesProvider.cs b/NzbDrone.Core/Providers/SeriesProvider.cs
index a6f2786c5..00afce4e3 100644
--- a/NzbDrone.Core/Providers/SeriesProvider.cs
+++ b/NzbDrone.Core/Providers/SeriesProvider.cs
@@ -55,6 +55,12 @@ namespace NzbDrone.Core.Providers
return _sonioRepo.Single(s => s.TvdbId == tvdbId.ToString());
}
+ public IList GetSeasons(long tvdbId)
+ {
+ return _sonioRepo.Find(c => c.SeriesId == tvdbId);
+ }
+
+
public void SyncSeriesWithDisk()
{
foreach (string seriesFolder in _diskProvider.GetDirectories(_config.SeriesRoot))
diff --git a/NzbDrone.Core/Repository/Season.cs b/NzbDrone.Core/Repository/Season.cs
new file mode 100644
index 000000000..d324d7fd1
--- /dev/null
+++ b/NzbDrone.Core/Repository/Season.cs
@@ -0,0 +1,16 @@
+using System;
+using System.ServiceModel.Syndication;
+using SubSonic.SqlGeneration.Schema;
+
+namespace NzbDrone.Core.Repository
+{
+ public class Season
+ {
+ [SubSonicPrimaryKey]
+ public string SeasonId { get; set; }
+ public long SeriesId { get; set; }
+ public int SeasonNumber { get; set; }
+ public bool Monitored { get; set; }
+ public string Folder { get; set; }
+ }
+}
\ No newline at end of file