2011-05-01 11:05:28 +03:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Web;
|
|
|
|
using System.Web.Mvc;
|
2012-02-09 04:05:16 +03:00
|
|
|
using System.Web.Script.Serialization;
|
2011-09-30 19:18:13 +03:00
|
|
|
using NzbDrone.Core;
|
2012-02-27 07:47:49 +03:00
|
|
|
using NzbDrone.Core.Helpers;
|
2011-05-01 11:05:28 +03:00
|
|
|
using NzbDrone.Core.Providers;
|
|
|
|
using NzbDrone.Web.Models;
|
2012-05-10 20:39:02 +03:00
|
|
|
using ServiceStack.Text;
|
2011-05-01 11:05:28 +03:00
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
{
|
|
|
|
public class MissingController : Controller
|
|
|
|
{
|
|
|
|
private readonly EpisodeProvider _episodeProvider;
|
|
|
|
|
|
|
|
public MissingController(EpisodeProvider episodeProvider)
|
|
|
|
{
|
|
|
|
_episodeProvider = episodeProvider;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ActionResult Index()
|
|
|
|
{
|
2012-02-09 04:05:16 +03: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,
|
2012-02-27 07:47:49 +03:00
|
|
|
SeriesTitleSorter = SortHelper.SkipArticles(e.Series.Title),
|
2012-02-14 21:48:13 +03:00
|
|
|
AirDate = e.AirDate.Value.ToString("MM/dd/yyyy"),
|
2012-02-09 04:05:16 +03:00
|
|
|
AirDateString = e.AirDate.Value.ToBestDateString()
|
|
|
|
});
|
|
|
|
|
2012-05-10 20:39:02 +03:00
|
|
|
JsConfig.IncludeNullValues = true;
|
2012-05-10 19:53:37 +03:00
|
|
|
return View(missing);
|
2011-05-01 11:05:28 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|