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

pull/4/head
Taloth Saldono 11 years ago
parent fd5e8a5166
commit 221a457f3a

@ -28,7 +28,7 @@ namespace NzbDrone.Api.Blacklist
//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 @@ namespace NzbDrone.Api.History
//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 @@ namespace NzbDrone.Api.Wanted
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 @@ namespace NzbDrone.Api.Wanted
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;

@ -35,33 +35,33 @@ define(
columns: columns:
[ [
{ {
name : 'series', name : 'series',
label: 'Series', label : 'Series',
cell : SeriesTitleCell, cell : SeriesTitleCell,
sortValue: 'series.title' sortValue : 'series.sortTitle'
}, },
{ {
name : 'sourceTitle', name : 'sourceTitle',
label: 'Source Title', label : 'Source Title',
cell : 'string', cell : 'string',
sortValue: 'sourceTitle' sortValue : 'sourceTitle'
}, },
{ {
name : 'quality', name : 'quality',
label : 'Quality', label : 'Quality',
cell : QualityCell, cell : QualityCell,
sortable: false sortable : false
}, },
{ {
name : 'date', name : 'date',
label: 'Date', label : 'Date',
cell : RelativeDateCell cell : RelativeDateCell
}, },
{ {
name : 'this', name : 'this',
label : '', label : '',
cell : BlacklistActionsCell, cell : BlacklistActionsCell,
sortable: false sortable : false
} }
], ],

@ -32,33 +32,34 @@ define(
columns: columns:
[ [
{ {
name : 'status', name : 'status',
label: '', label : '',
cell : QueueStatusCell, cell : QueueStatusCell,
cellValue: 'this' cellValue : 'this'
}, },
{ {
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',
label : 'Quality', label : 'Quality',
cell : QualityCell, cell : QualityCell,
sortable: false sortable : false
}, },
{ {
name : 'timeleft', name : 'timeleft',

@ -39,45 +39,45 @@ define(
columns: columns:
[ [
{ {
name : 'eventType', name : 'eventType',
label : '', label : '',
cell : EventTypeCell, cell : EventTypeCell,
cellValue: 'this' cellValue : 'this'
}, },
{ {
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',
label : 'Quality', label : 'Quality',
cell : QualityCell, cell : QualityCell,
sortable: false sortable : false
}, },
{ {
name : 'date', name : 'date',
label: 'Date', label : 'Date',
cell : RelativeDateCell cell : RelativeDateCell
}, },
{ {
name : 'this', name : 'this',
label : '', label : '',
cell : HistoryDetailsCell, cell : HistoryDetailsCell,
sortable: false sortable : false
} }
], ],

@ -57,25 +57,26 @@ define(
cell : SeriesStatusCell cell : SeriesStatusCell
}, },
{ {
name : 'title', name : 'title',
label : 'Title', label : 'Title',
cell : SeriesTitleCell, cell : SeriesTitleCell,
cellValue: 'this' cellValue : 'this',
sortValue : 'sortTitle'
}, },
{ {
name : 'qualityProfileId', name : 'qualityProfileId',
label: 'Quality', label : 'Quality',
cell : QualityProfileCell cell : QualityProfileCell
}, },
{ {
name : 'seasonFolder', name : 'seasonFolder',
label: 'Season Folder', label : 'Season Folder',
cell : SeasonFolderCell cell : SeasonFolderCell
}, },
{ {
name : 'path', name : 'path',
label: 'Path', label : 'Path',
cell : 'string' cell : 'string'
} }
], ],

@ -53,25 +53,26 @@ define(
cell : SeriesStatusCell cell : SeriesStatusCell
}, },
{ {
name : 'title', name : 'title',
label : 'Title', label : 'Title',
cell : SeriesTitleCell, cell : SeriesTitleCell,
cellValue: 'this' cellValue : 'this',
sortValue : 'sortTitle'
}, },
{ {
name : 'seasonCount', name : 'seasonCount',
label: 'Seasons', label : 'Seasons',
cell : 'integer' cell : 'integer'
}, },
{ {
name : 'qualityProfileId', name : 'qualityProfileId',
label: 'Quality', label : 'Quality',
cell : QualityProfileCell cell : QualityProfileCell
}, },
{ {
name : 'network', name : 'network',
label: 'Network', label : 'Network',
cell : 'string' cell : 'string'
}, },
{ {
name : 'nextAiring', name : 'nextAiring',
@ -80,16 +81,16 @@ define(
sortValue : SeriesCollection.nextAiring sortValue : SeriesCollection.nextAiring
}, },
{ {
name : 'percentOfEpisodes', name : 'percentOfEpisodes',
label : 'Episodes', label : 'Episodes',
cell : EpisodeProgressCell, cell : EpisodeProgressCell,
className: 'episode-progress-cell' className : 'episode-progress-cell'
}, },
{ {
name : 'this', name : 'this',
label : '', label : '',
sortable: false, sortable : false,
cell : SeriesActionsCell cell : SeriesActionsCell
} }
], ],

@ -45,39 +45,39 @@ define([
columns : [ columns : [
{ {
name : '', name : '',
cell : 'select-row', cell : 'select-row',
headerCell : 'select-all', headerCell: 'select-all',
sortable : false sortable : false
}, },
{ {
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',
label : 'Air Date', label : 'Air Date',
cell : RelativeDateCell cell : RelativeDateCell
}, },
{ {
name : 'status', name : 'status',
label : 'Status', label : 'Status',
cell : EpisodeStatusCell, cell : EpisodeStatusCell,
sortable : false sortable : false
} }
], ],

@ -45,39 +45,39 @@ define([
columns : [ columns : [
{ {
name : '', name : '',
cell : 'select-row', cell : 'select-row',
headerCell : 'select-all', headerCell: 'select-all',
sortable : false sortable : false
}, },
{ {
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',
label : 'Air Date', label : 'Air Date',
cell : RelativeDateCell cell : RelativeDateCell
}, },
{ {
name : 'status', name : 'status',
label : 'Status', label : 'Status',
cell : EpisodeStatusCell, cell : EpisodeStatusCell,
sortable : false sortable : false
} }
], ],

Loading…
Cancel
Save