1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-16 16:04:08 +01:00
Radarr/NzbDrone.Web/Controllers/MissingController.cs

47 lines
1.4 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using NzbDrone.Core;
using NzbDrone.Core.Helpers;
using NzbDrone.Core.Providers;
using NzbDrone.Web.Models;
2012-05-10 19:39:02 +02:00
using ServiceStack.Text;
namespace NzbDrone.Web.Controllers
{
public class MissingController : Controller
{
private readonly EpisodeProvider _episodeProvider;
public MissingController(EpisodeProvider episodeProvider)
{
_episodeProvider = episodeProvider;
}
public ActionResult Index()
{
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,
SeriesTitleSorter = SortHelper.SkipArticles(e.Series.Title),
AirDateSorter = e.AirDate.Value.ToString("o", CultureInfo.InvariantCulture),
AirDate = e.AirDate.Value.ToBestDateString()
});
2012-05-10 19:39:02 +02:00
JsConfig.IncludeNullValues = true;
return View(missing);
}
}
}