Added more stubbed mothods and providers

pull/4/head
Keivan 14 years ago
parent 8d47bcbe5e
commit bca2e0c6b1

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

@ -6,7 +6,7 @@ using SubSonic.Repository;
namespace NzbDrone.Core.Providers 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 //TODO: Remove parsing of the series name, it should be done in series provider
private static readonly Regex ParseRegex = new Regex(@"(?<showName>.*) private static readonly Regex ParseRegex = new Regex(@"(?<showName>.*)
@ -44,6 +44,16 @@ namespace NzbDrone.Core.Providers
throw new NotImplementedException(); 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) public String GetSabTitle(Episode episode)
{ {
var series = _seriesProvider.GetSeries(episode.SeriesId); var series = _seriesProvider.GetSeries(episode.SeriesId);
@ -59,7 +69,7 @@ namespace NzbDrone.Core.Providers
/// </summary> /// </summary>
/// <param name="episode">Episode that needs to be checked</param> /// <param name="episode">Episode that needs to be checked</param>
/// <returns></returns> /// <returns></returns>
public bool IsEpisodeNeeded(Episode episode) public bool IsNeeded(Episode episode)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

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

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

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

@ -55,6 +55,12 @@ namespace NzbDrone.Core.Providers
return _sonioRepo.Single<Series>(s => s.TvdbId == tvdbId.ToString()); 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() public void SyncSeriesWithDisk()
{ {
foreach (string seriesFolder in _diskProvider.GetDirectories(_config.SeriesRoot)) foreach (string seriesFolder in _diskProvider.GetDirectories(_config.SeriesRoot))

@ -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; }
}
}
Loading…
Cancel
Save