2011-05-01 08:05:28 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Mvc;
|
2012-02-09 01:05:16 +00:00
|
|
|
|
using System.Web.Script.Serialization;
|
2011-09-30 16:18:13 +00:00
|
|
|
|
using NzbDrone.Core;
|
2011-05-01 08:05:28 +00:00
|
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
|
using NzbDrone.Web.Models;
|
|
|
|
|
using Telerik.Web.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class MissingController : Controller
|
|
|
|
|
{
|
|
|
|
|
private readonly EpisodeProvider _episodeProvider;
|
|
|
|
|
|
|
|
|
|
public MissingController(EpisodeProvider episodeProvider)
|
|
|
|
|
{
|
|
|
|
|
_episodeProvider = episodeProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
|
{
|
2012-02-09 01:05:16 +00:00
|
|
|
|
var missingEpisodes = _episodeProvider.EpisodesWithoutFiles(false);
|
|
|
|
|
|
|
|
|
|
var missing = missingEpisodes.Select(e => new MissingEpisodeModel
|
|
|
|
|
{
|
|
|
|
|
EpisodeId = e.EpisodeId,
|
|
|
|
|
SeriesId = e.SeriesId,
|
|
|
|
|
EpisodeNumbering = string.Format("{0}x{1:00}", e.SeasonNumber, e.EpisodeNumber),
|
|
|
|
|
EpisodeTitle = e.Title,
|
|
|
|
|
Overview = e.Overview,
|
|
|
|
|
SeriesTitle = e.Series.Title,
|
|
|
|
|
AirDate = e.AirDate.Value.ToString(),
|
|
|
|
|
AirDateString = e.AirDate.Value.ToBestDateString()
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var serialized = new JavaScriptSerializer().Serialize(missing);
|
|
|
|
|
|
|
|
|
|
return View((object)serialized);
|
2011-05-01 08:05:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|