1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-01-17 10:45:49 +02:00

Fixed: Sorting on Series Title now ignores articles (a/an/the).

This commit is contained in:
Taloth Saldono 2014-06-21 00:29:12 +02:00
parent fd5e8a5166
commit 221a457f3a
11 changed files with 166 additions and 149 deletions

View File

@ -28,7 +28,7 @@ private PagingResource<BlacklistResource> GetBlacklist(PagingResource<BlacklistR
//This is a hack to deal with backgrid setting the sortKey to the column name instead of sortValue
if (pagingSpec.SortKey.Equals("series", StringComparison.InvariantCultureIgnoreCase))
{
pagingSpec.SortKey = "series.title";
pagingSpec.SortKey = "series.sortTitle";
}
return ApplyToPage(_blacklistService.Paged, pagingSpec);

View File

@ -36,7 +36,7 @@ private PagingResource<HistoryResource> GetHistory(PagingResource<HistoryResourc
//This is a hack to deal with backgrid setting the sortKey to the column name instead of sortValue
if (pagingSpec.SortKey.Equals("series", StringComparison.InvariantCultureIgnoreCase))
{
pagingSpec.SortKey = "series.title";
pagingSpec.SortKey = "series.sortTitle";
}
if (pagingResource.FilterKey == "eventType")

View File

@ -1,4 +1,5 @@
using System.Linq;
using System;
using System.Linq;
using NzbDrone.Api.Episodes;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.Datastore;
@ -30,6 +31,12 @@ private PagingResource<EpisodeResource> GetCutoffUnmetEpisodes(PagingResource<Ep
SortDirection = pagingResource.SortDirection
};
//This is a hack to deal with backgrid setting the sortKey to the column name instead of sortValue
if (pagingSpec.SortKey.Equals("series", StringComparison.InvariantCultureIgnoreCase))
{
pagingSpec.SortKey = "series.sortTitle";
}
if (pagingResource.FilterKey == "monitored" && pagingResource.FilterValue == "false")
{
pagingSpec.FilterExpression = v => v.Monitored == false || v.Series.Monitored == false;

View File

@ -1,4 +1,5 @@
using System.Linq;
using System;
using System.Linq;
using NzbDrone.Api.Episodes;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.Datastore;
@ -30,6 +31,12 @@ private PagingResource<EpisodeResource> GetMissingEpisodes(PagingResource<Episod
SortDirection = pagingResource.SortDirection
};
//This is a hack to deal with backgrid setting the sortKey to the column name instead of sortValue
if (pagingSpec.SortKey.Equals("series", StringComparison.InvariantCultureIgnoreCase))
{
pagingSpec.SortKey = "series.sortTitle";
}
if (pagingResource.FilterKey == "monitored" && pagingResource.FilterValue == "false")
{
pagingSpec.FilterExpression = v => v.Monitored == false || v.Series.Monitored == false;

View File

@ -38,7 +38,7 @@ define(
name : 'series',
label : 'Series',
cell : SeriesTitleCell,
sortValue: 'series.title'
sortValue : 'series.sortTitle'
},
{
name : 'sourceTitle',

View File

@ -40,19 +40,20 @@ define(
{
name : 'series',
label : 'Series',
cell : SeriesTitleCell
cell : SeriesTitleCell,
sortable : false
},
{
name : 'episode',
label : 'Episode',
sortable: false,
cell : EpisodeNumberCell
cell : EpisodeNumberCell,
sortable : false
},
{
name : 'episode',
label : 'Episode Title',
sortable: false,
cell : EpisodeTitleCell
cell : EpisodeTitleCell,
sortable : false
},
{
name : 'quality',

View File

@ -48,19 +48,19 @@ define(
name : 'series',
label : 'Series',
cell : SeriesTitleCell,
sortValue: 'series.title'
sortValue : 'series.sortTitle'
},
{
name : 'episode',
label : 'Episode',
sortable: false,
cell : EpisodeNumberCell
cell : EpisodeNumberCell,
sortable : false
},
{
name : 'episode',
label : 'Episode Title',
sortable: false,
cell : EpisodeTitleCell
cell : EpisodeTitleCell,
sortable : false
},
{
name : 'quality',

View File

@ -60,7 +60,8 @@ define(
name : 'title',
label : 'Title',
cell : SeriesTitleCell,
cellValue: 'this'
cellValue : 'this',
sortValue : 'sortTitle'
},
{
name : 'qualityProfileId',

View File

@ -56,7 +56,8 @@ define(
name : 'title',
label : 'Title',
cell : SeriesTitleCell,
cellValue: 'this'
cellValue : 'this',
sortValue : 'sortTitle'
},
{
name : 'seasonCount',

View File

@ -53,20 +53,20 @@ define([
{
name : 'series',
label : 'Series Title',
sortable : false,
cell : SeriesTitleCell
cell : SeriesTitleCell,
sortValue : 'series.sortTitle'
},
{
name : 'this',
label : 'Episode',
sortable : false,
cell : EpisodeNumberCell
cell : EpisodeNumberCell,
sortable : false
},
{
name : 'this',
label : 'Episode Title',
sortable : false,
cell : EpisodeTitleCell
cell : EpisodeTitleCell,
sortable : false
},
{
name : 'airDateUtc',

View File

@ -53,20 +53,20 @@ define([
{
name : 'series',
label : 'Series Title',
sortable : false,
cell : SeriesTitleCell
cell : SeriesTitleCell,
sortValue : 'series.sortTitle'
},
{
name : 'this',
label : 'Episode',
sortable : false,
cell : EpisodeNumberCell
cell : EpisodeNumberCell,
sortable : false
},
{
name : 'this',
label : 'Episode Title',
sortable : false,
cell : EpisodeTitleCell
cell : EpisodeTitleCell,
sortable : false
},
{
name : 'airDateUtc',