Removed IUpcomingEpisodesProvider

pull/3113/head
Mark McDowall 14 years ago
parent 83ebd89ff8
commit 8380c25eaf

@ -64,7 +64,7 @@ namespace NzbDrone.Core
_kernel.Bind<IRssSyncProvider>().To<RssSyncProvider>().InSingletonScope();
_kernel.Bind<ISeasonProvider>().To<SeasonProvider>();
_kernel.Bind<IEpisodeProvider>().To<EpisodeProvider>();
_kernel.Bind<IUpcomingEpisodesProvider>().To<UpcomingEpisodesProvider>();
_kernel.Bind<UpcomingEpisodesProvider>().To<UpcomingEpisodesProvider>();
_kernel.Bind<IDiskProvider>().To<DiskProvider>();
_kernel.Bind<IDownloadProvider>().To<SabProvider>();
_kernel.Bind<IHistoryProvider>().To<HistoryProvider>();

@ -191,7 +191,6 @@
<Compile Include="Providers\IRenameProvider.cs" />
<Compile Include="Providers\IRssSyncProvider.cs" />
<Compile Include="Providers\ITimerProvider.cs" />
<Compile Include="Providers\IUpcomingEpisodesProvider.cs" />
<Compile Include="Providers\PostProcessingProvider.cs" />
<Compile Include="Providers\QualityProvider.cs" />
<Compile Include="Providers\RenameProvider.cs" />

@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NzbDrone.Core.Model;
using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers
{
public interface IUpcomingEpisodesProvider
{
UpcomingEpisodesModel Upcoming();
List<Episode> Yesterday();
List<Episode> Today();
List<Episode> Week();
}
}

@ -8,7 +8,7 @@ using SubSonic.Repository;
namespace NzbDrone.Core.Providers
{
public class UpcomingEpisodesProvider : IUpcomingEpisodesProvider
public class UpcomingEpisodesProvider
{
private IRepository _sonicRepo;
@ -17,9 +17,9 @@ namespace NzbDrone.Core.Providers
_sonicRepo = sonicRepo;
}
#region IUpcomingEpisodesProvider
#region UpcomingEpisodesProvider Members
public UpcomingEpisodesModel Upcoming()
public virtual UpcomingEpisodesModel Upcoming()
{
var allEps = _sonicRepo.All<Episode>().Where(e => e.AirDate >= DateTime.Today.AddDays(-1) && e.AirDate < DateTime.Today.AddDays(8));
@ -30,17 +30,17 @@ namespace NzbDrone.Core.Providers
return new UpcomingEpisodesModel {Yesterday = yesterday, Today = today, Week = week};
}
public List<Episode> Yesterday()
public virtual List<Episode> Yesterday()
{
return _sonicRepo.All<Episode>().Where(e => e.AirDate == DateTime.Today.AddDays(-1)).ToList();
}
public List<Episode> Today()
public virtual List<Episode> Today()
{
return _sonicRepo.All<Episode>().Where(e => e.AirDate == DateTime.Today).ToList();
}
public List<Episode> Week()
public virtual List<Episode> Week()
{
return _sonicRepo.All<Episode>().Where(e => e.AirDate > DateTime.Today && e.AirDate < DateTime.Today.AddDays(8)).ToList();
}

@ -11,9 +11,9 @@ namespace NzbDrone.Web.Controllers
{
public class UpcomingController : Controller
{
private IUpcomingEpisodesProvider _upcomingEpisodesProvider;
private UpcomingEpisodesProvider _upcomingEpisodesProvider;
public UpcomingController(IUpcomingEpisodesProvider upcomingEpisodesProvider)
public UpcomingController(UpcomingEpisodesProvider upcomingEpisodesProvider)
{
_upcomingEpisodesProvider = upcomingEpisodesProvider;
}

Loading…
Cancel
Save