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:
parent
fd5e8a5166
commit
221a457f3a
@ -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
|
//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))
|
if (pagingSpec.SortKey.Equals("series", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
pagingSpec.SortKey = "series.title";
|
pagingSpec.SortKey = "series.sortTitle";
|
||||||
}
|
}
|
||||||
|
|
||||||
return ApplyToPage(_blacklistService.Paged, pagingSpec);
|
return ApplyToPage(_blacklistService.Paged, pagingSpec);
|
||||||
|
@ -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
|
//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))
|
if (pagingSpec.SortKey.Equals("series", StringComparison.InvariantCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
pagingSpec.SortKey = "series.title";
|
pagingSpec.SortKey = "series.sortTitle";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pagingResource.FilterKey == "eventType")
|
if (pagingResource.FilterKey == "eventType")
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using NzbDrone.Api.Episodes;
|
using NzbDrone.Api.Episodes;
|
||||||
using NzbDrone.Api.Extensions;
|
using NzbDrone.Api.Extensions;
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
@ -30,6 +31,12 @@ private PagingResource<EpisodeResource> GetCutoffUnmetEpisodes(PagingResource<Ep
|
|||||||
SortDirection = pagingResource.SortDirection
|
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")
|
if (pagingResource.FilterKey == "monitored" && pagingResource.FilterValue == "false")
|
||||||
{
|
{
|
||||||
pagingSpec.FilterExpression = v => v.Monitored == false || v.Series.Monitored == false;
|
pagingSpec.FilterExpression = v => v.Monitored == false || v.Series.Monitored == false;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using NzbDrone.Api.Episodes;
|
using NzbDrone.Api.Episodes;
|
||||||
using NzbDrone.Api.Extensions;
|
using NzbDrone.Api.Extensions;
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
@ -30,6 +31,12 @@ private PagingResource<EpisodeResource> GetMissingEpisodes(PagingResource<Episod
|
|||||||
SortDirection = pagingResource.SortDirection
|
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")
|
if (pagingResource.FilterKey == "monitored" && pagingResource.FilterValue == "false")
|
||||||
{
|
{
|
||||||
pagingSpec.FilterExpression = v => v.Monitored == false || v.Series.Monitored == false;
|
pagingSpec.FilterExpression = v => v.Monitored == false || v.Series.Monitored == false;
|
||||||
|
@ -38,7 +38,7 @@ define(
|
|||||||
name : 'series',
|
name : 'series',
|
||||||
label : 'Series',
|
label : 'Series',
|
||||||
cell : SeriesTitleCell,
|
cell : SeriesTitleCell,
|
||||||
sortValue: 'series.title'
|
sortValue : 'series.sortTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'sourceTitle',
|
name : 'sourceTitle',
|
||||||
|
@ -40,19 +40,20 @@ define(
|
|||||||
{
|
{
|
||||||
name : 'series',
|
name : 'series',
|
||||||
label : 'Series',
|
label : 'Series',
|
||||||
cell : SeriesTitleCell
|
cell : SeriesTitleCell,
|
||||||
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'episode',
|
name : 'episode',
|
||||||
label : 'Episode',
|
label : 'Episode',
|
||||||
sortable: false,
|
cell : EpisodeNumberCell,
|
||||||
cell : EpisodeNumberCell
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'episode',
|
name : 'episode',
|
||||||
label : 'Episode Title',
|
label : 'Episode Title',
|
||||||
sortable: false,
|
cell : EpisodeTitleCell,
|
||||||
cell : EpisodeTitleCell
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'quality',
|
name : 'quality',
|
||||||
|
@ -48,19 +48,19 @@ define(
|
|||||||
name : 'series',
|
name : 'series',
|
||||||
label : 'Series',
|
label : 'Series',
|
||||||
cell : SeriesTitleCell,
|
cell : SeriesTitleCell,
|
||||||
sortValue: 'series.title'
|
sortValue : 'series.sortTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'episode',
|
name : 'episode',
|
||||||
label : 'Episode',
|
label : 'Episode',
|
||||||
sortable: false,
|
cell : EpisodeNumberCell,
|
||||||
cell : EpisodeNumberCell
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'episode',
|
name : 'episode',
|
||||||
label : 'Episode Title',
|
label : 'Episode Title',
|
||||||
sortable: false,
|
cell : EpisodeTitleCell,
|
||||||
cell : EpisodeTitleCell
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'quality',
|
name : 'quality',
|
||||||
|
@ -60,7 +60,8 @@ define(
|
|||||||
name : 'title',
|
name : 'title',
|
||||||
label : 'Title',
|
label : 'Title',
|
||||||
cell : SeriesTitleCell,
|
cell : SeriesTitleCell,
|
||||||
cellValue: 'this'
|
cellValue : 'this',
|
||||||
|
sortValue : 'sortTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'qualityProfileId',
|
name : 'qualityProfileId',
|
||||||
|
@ -56,7 +56,8 @@ define(
|
|||||||
name : 'title',
|
name : 'title',
|
||||||
label : 'Title',
|
label : 'Title',
|
||||||
cell : SeriesTitleCell,
|
cell : SeriesTitleCell,
|
||||||
cellValue: 'this'
|
cellValue : 'this',
|
||||||
|
sortValue : 'sortTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'seasonCount',
|
name : 'seasonCount',
|
||||||
|
@ -53,20 +53,20 @@ define([
|
|||||||
{
|
{
|
||||||
name : 'series',
|
name : 'series',
|
||||||
label : 'Series Title',
|
label : 'Series Title',
|
||||||
sortable : false,
|
cell : SeriesTitleCell,
|
||||||
cell : SeriesTitleCell
|
sortValue : 'series.sortTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'this',
|
name : 'this',
|
||||||
label : 'Episode',
|
label : 'Episode',
|
||||||
sortable : false,
|
cell : EpisodeNumberCell,
|
||||||
cell : EpisodeNumberCell
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'this',
|
name : 'this',
|
||||||
label : 'Episode Title',
|
label : 'Episode Title',
|
||||||
sortable : false,
|
cell : EpisodeTitleCell,
|
||||||
cell : EpisodeTitleCell
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'airDateUtc',
|
name : 'airDateUtc',
|
||||||
|
@ -53,20 +53,20 @@ define([
|
|||||||
{
|
{
|
||||||
name : 'series',
|
name : 'series',
|
||||||
label : 'Series Title',
|
label : 'Series Title',
|
||||||
sortable : false,
|
cell : SeriesTitleCell,
|
||||||
cell : SeriesTitleCell
|
sortValue : 'series.sortTitle'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'this',
|
name : 'this',
|
||||||
label : 'Episode',
|
label : 'Episode',
|
||||||
sortable : false,
|
cell : EpisodeNumberCell,
|
||||||
cell : EpisodeNumberCell
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'this',
|
name : 'this',
|
||||||
label : 'Episode Title',
|
label : 'Episode Title',
|
||||||
sortable : false,
|
cell : EpisodeTitleCell,
|
||||||
cell : EpisodeTitleCell
|
sortable : false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name : 'airDateUtc',
|
name : 'airDateUtc',
|
||||||
|
Loading…
Reference in New Issue
Block a user