2011-04-27 04:47:29 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
2011-03-23 08:06:22 +01:00
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
using NzbDrone.Web.Models;
|
|
|
|
|
using Telerik.Web.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class UpcomingController : Controller
|
|
|
|
|
{
|
2011-04-10 04:44:01 +02:00
|
|
|
|
private readonly UpcomingEpisodesProvider _upcomingEpisodesProvider;
|
2011-03-23 08:06:22 +01:00
|
|
|
|
|
2011-04-08 17:18:01 +02:00
|
|
|
|
public UpcomingController(UpcomingEpisodesProvider upcomingEpisodesProvider)
|
2011-03-23 08:06:22 +01:00
|
|
|
|
{
|
|
|
|
|
_upcomingEpisodesProvider = upcomingEpisodesProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// GET: /Upcoming/
|
|
|
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[GridAction]
|
|
|
|
|
public ActionResult _AjaxBindingYesterday()
|
|
|
|
|
{
|
|
|
|
|
var upcoming = _upcomingEpisodesProvider.Yesterday().Select(e => new UpcomingEpisodeModel
|
2011-04-10 04:44:01 +02:00
|
|
|
|
{
|
|
|
|
|
SeriesId = e.Series.SeriesId,
|
|
|
|
|
SeriesName = e.Series.Title,
|
|
|
|
|
SeasonNumber = e.SeasonNumber,
|
|
|
|
|
EpisodeNumber = e.EpisodeNumber,
|
|
|
|
|
Title = e.Title,
|
|
|
|
|
Overview = e.Overview,
|
2011-04-27 04:47:29 +02:00
|
|
|
|
AirDate = e.AirDate.Add(Convert.ToDateTime(e.Series.AirTimes).TimeOfDay)
|
2011-04-10 04:44:01 +02:00
|
|
|
|
});
|
|
|
|
|
|
2011-03-23 08:06:22 +01:00
|
|
|
|
return View(new GridModel(upcoming));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[GridAction]
|
|
|
|
|
public ActionResult _AjaxBindingToday()
|
|
|
|
|
{
|
|
|
|
|
var upcoming = _upcomingEpisodesProvider.Today().Select(e => new UpcomingEpisodeModel
|
2011-04-10 04:44:01 +02:00
|
|
|
|
{
|
|
|
|
|
SeriesId = e.Series.SeriesId,
|
|
|
|
|
SeriesName = e.Series.Title,
|
|
|
|
|
SeasonNumber = e.SeasonNumber,
|
|
|
|
|
EpisodeNumber = e.EpisodeNumber,
|
|
|
|
|
Title = e.Title,
|
|
|
|
|
Overview = e.Overview,
|
2011-04-27 04:47:29 +02:00
|
|
|
|
AirDate = e.AirDate.Add(Convert.ToDateTime(e.Series.AirTimes).TimeOfDay)
|
2011-04-10 04:44:01 +02:00
|
|
|
|
});
|
2011-03-23 08:06:22 +01:00
|
|
|
|
|
|
|
|
|
return View(new GridModel(upcoming));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[GridAction]
|
|
|
|
|
public ActionResult _AjaxBindingWeek()
|
|
|
|
|
{
|
|
|
|
|
var upcoming = _upcomingEpisodesProvider.Week().Select(e => new UpcomingEpisodeModel
|
2011-04-10 04:44:01 +02:00
|
|
|
|
{
|
|
|
|
|
SeriesId = e.Series.SeriesId,
|
|
|
|
|
SeriesName = e.Series.Title,
|
|
|
|
|
SeasonNumber = e.SeasonNumber,
|
|
|
|
|
EpisodeNumber = e.EpisodeNumber,
|
|
|
|
|
Title = e.Title,
|
|
|
|
|
Overview = e.Overview,
|
2011-04-27 04:47:29 +02:00
|
|
|
|
AirDate = e.AirDate.Add(Convert.ToDateTime(e.Series.AirTimes).TimeOfDay)
|
2011-04-10 04:44:01 +02:00
|
|
|
|
});
|
2011-03-23 08:06:22 +01:00
|
|
|
|
|
|
|
|
|
return View(new GridModel(upcoming));
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-04-10 04:44:01 +02:00
|
|
|
|
}
|