mirror of https://github.com/Radarr/Radarr
Fixed: Sort by Next Airing will always keep empty values at the bottom
This commit is contained in:
parent
ca9c6c651f
commit
a5d7809b72
|
@ -81,8 +81,8 @@ define(
|
|||
}
|
||||
|
||||
return function (left, right) {
|
||||
var l = sortValue(left, sortKey);
|
||||
var r = sortValue(right, sortKey);
|
||||
var l = sortValue(left, sortKey, order);
|
||||
var r = sortValue(right, sortKey, order);
|
||||
var t;
|
||||
|
||||
if (order === 1) {
|
||||
|
@ -94,8 +94,8 @@ define(
|
|||
if (l === r) {
|
||||
|
||||
if (secondarySorting) {
|
||||
var ls = secondarySorting.sortValue(left, secondarySorting.key);
|
||||
var rs = secondarySorting.sortValue(right, secondarySorting.key);
|
||||
var ls = secondarySorting.sortValue(left, secondarySorting.key, order);
|
||||
var rs = secondarySorting.sortValue(right, secondarySorting.key, order);
|
||||
var ts;
|
||||
|
||||
if (secondarySorting.order === 1) {
|
||||
|
|
|
@ -62,17 +62,15 @@ define(
|
|||
sortMappings: {
|
||||
'title' : { sortKey: 'sortTitle' },
|
||||
'nextAiring' : {
|
||||
sortValue: function (model, attr) {
|
||||
sortValue: function (model, attr, order) {
|
||||
var nextAiring = model.get(attr);
|
||||
|
||||
if (nextAiring) {
|
||||
return moment(nextAiring).unix();
|
||||
}
|
||||
|
||||
var previousAiring = model.get(attr.replace('nextAiring', 'previousAiring'));
|
||||
|
||||
if (previousAiring) {
|
||||
return 10000000000 - moment(previousAiring).unix();
|
||||
if (order === 1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Number.MAX_VALUE;
|
||||
|
|
Loading…
Reference in New Issue