mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Allow sorting with articles (option)
New: Option to sort with articles (a, the, an) included
This commit is contained in:
parent
978e564845
commit
2439b9e087
12 changed files with 63 additions and 21 deletions
|
|
@ -8,6 +8,7 @@ using DataTables.Mvc.Core.Models;
|
|||
using NzbDrone.Core.Helpers;
|
||||
using NzbDrone.Core.Jobs;
|
||||
using NzbDrone.Core.Providers;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Web.Models;
|
||||
|
||||
namespace NzbDrone.Web.Controllers
|
||||
|
|
@ -16,11 +17,14 @@ namespace NzbDrone.Web.Controllers
|
|||
{
|
||||
private readonly HistoryProvider _historyProvider;
|
||||
private readonly JobProvider _jobProvider;
|
||||
private readonly ConfigProvider _configProvider;
|
||||
|
||||
public HistoryController(HistoryProvider historyProvider, JobProvider jobProvider)
|
||||
public HistoryController(HistoryProvider historyProvider, JobProvider jobProvider,
|
||||
ConfigProvider configProvider)
|
||||
{
|
||||
_historyProvider = historyProvider;
|
||||
_jobProvider = jobProvider;
|
||||
_configProvider = configProvider;
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
|
|
@ -32,6 +36,7 @@ namespace NzbDrone.Web.Controllers
|
|||
{
|
||||
var pageResult = _historyProvider.GetPagedItems(pageRequest);
|
||||
var totalItems = _historyProvider.Count();
|
||||
var ignoreArticles = _configProvider.IgnoreArticlesWhenSortingSeries;
|
||||
|
||||
var items = pageResult.Items.Select(h => new HistoryModel
|
||||
{
|
||||
|
|
@ -41,7 +46,7 @@ namespace NzbDrone.Web.Controllers
|
|||
EpisodeTitle = h.EpisodeTitle,
|
||||
EpisodeOverview = h.EpisodeOverview,
|
||||
SeriesTitle = h.SeriesTitle,
|
||||
SeriesTitleSorter = SortHelper.SkipArticles(h.SeriesTitle),
|
||||
SeriesTitleSorter = ignoreArticles ? h.SeriesTitle.IgnoreArticles() : h.SeriesTitle,
|
||||
NzbTitle = h.NzbTitle,
|
||||
Quality = h.Quality.ToString(),
|
||||
IsProper = h.IsProper,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue