Added more stubbed mothods and providers

This commit is contained in:
Keivan 2010-09-28 13:44:33 -07:00
parent 8d47bcbe5e
commit bca2e0c6b1
7 changed files with 75 additions and 3 deletions

View File

@ -140,11 +140,14 @@
<Compile Include="Providers\EpisodeProvider.cs" />
<Compile Include="Providers\HttpProvider.cs" />
<Compile Include="Providers\IDownloadProvider.cs" />
<Compile Include="Providers\IEpisodeProvider.cs" />
<Compile Include="Providers\IHttpProvider.cs" />
<Compile Include="Providers\ISeasonProvider.cs" />
<Compile Include="Providers\ISeriesProvider.cs" />
<Compile Include="Providers\ITvDbProvider.cs" />
<Compile Include="Providers\SabProvider.cs" />
<Compile Include="Repository\Config.cs" />
<Compile Include="Repository\Season.cs" />
<Compile Include="Repository\RemoteEpisode.cs" />
<Compile Include="Repository\LocalEpisode.cs" />
<Compile Include="Repository\Episode.cs" />

View File

@ -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(@"(?<showName>.*)
@ -44,6 +44,16 @@ namespace NzbDrone.Core.Providers
throw new NotImplementedException();
}
public IList<Episode> GetEpisodesBySeason(long seasonId)
{
throw new NotImplementedException();
}
public IList<Episode> 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
/// </summary>
/// <param name="episode">Episode that needs to be checked</param>
/// <returns></returns>
public bool IsEpisodeNeeded(Episode episode)
public bool IsNeeded(Episode episode)
{
throw new NotImplementedException();
}

View File

@ -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<Episode> GetEpisodesBySeason(long seasonId);
IList<Episode> GetEpisodeBySeries(long seriesId);
String GetSabTitle(Episode episode);
/// <summary>
/// Comprehensive check on whether or not this episode is needed.
/// </summary>
/// <param name="episode">Episode that needs to be checked</param>
/// <returns></returns>
bool IsNeeded(Episode episode);
}
}

View File

@ -0,0 +1,14 @@
using System.Collections.Generic;
using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers
{
public interface ISeasonProvider
{
Season GetSeason(long seasonId);
List<Season> GetSeasongs(long seriesId);
int SaveSeason(Season season);
}
}

View File

@ -1,4 +1,5 @@
using System.Linq;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers

View File

@ -55,6 +55,12 @@ namespace NzbDrone.Core.Providers
return _sonioRepo.Single<Series>(s => s.TvdbId == tvdbId.ToString());
}
public IList<Season> GetSeasons(long tvdbId)
{
return _sonioRepo.Find<Season>(c => c.SeriesId == tvdbId);
}
public void SyncSeriesWithDisk()
{
foreach (string seriesFolder in _diskProvider.GetDirectories(_config.SeriesRoot))

View File

@ -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; }
}
}