mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 00:53:57 -07:00
History VIew Added.
Fixed Relationships between History and Episode/Indexer. Indexer now uses int as ID, string caused issues. Get single Indexer by ID.
This commit is contained in:
parent
4f2f5a3d71
commit
33b09567ce
14 changed files with 1704 additions and 48 deletions
62
NzbDrone.Web/Controllers/HistoryController.cs
Normal file
62
NzbDrone.Web/Controllers/HistoryController.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
using NzbDrone.Web.Models;
|
||||
using Telerik.Web.Mvc;
|
||||
|
||||
namespace NzbDrone.Web.Controllers
|
||||
{
|
||||
public class HistoryController : Controller
|
||||
{
|
||||
private IHistoryProvider _historyProvider;
|
||||
|
||||
public HistoryController(IHistoryProvider historyProvider)
|
||||
{
|
||||
_historyProvider = historyProvider;
|
||||
}
|
||||
|
||||
//
|
||||
// GET: /History/
|
||||
|
||||
public ActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public ActionResult Trim()
|
||||
{
|
||||
_historyProvider.Trim();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
public ActionResult Purge()
|
||||
{
|
||||
_historyProvider.Purge();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
||||
[GridAction]
|
||||
public ActionResult _AjaxBinding()
|
||||
{
|
||||
var history = _historyProvider.AllItems().Select(h => new HistoryModel
|
||||
{
|
||||
HistoryId = h.HistoryId,
|
||||
SeasonNumber = h.Episode.SeasonNumber,
|
||||
EpisodeNumber = h.Episode.EpisodeNumber,
|
||||
EpisodeTitle = h.Episode.Title,
|
||||
EpisodeOverview = h.Episode.Overview,
|
||||
SeriesTitle = h.Episode.Series.Title,
|
||||
NzbTitle = h.NzbTitle,
|
||||
Quality = h.Quality.ToString("G"),
|
||||
IsProper = h.IsProper,
|
||||
Date = h.Date
|
||||
});
|
||||
|
||||
return View(new GridModel(history));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue