Fixed: Sorting series without a Previous Airing

Closes #4809
This commit is contained in:
Mark McDowall 2021-12-19 09:27:15 -08:00
parent b869ebeac2
commit 52d8f87c66
1 changed files with 14 additions and 0 deletions

View File

@ -210,6 +210,20 @@ export const defaultState = {
return Number.MAX_VALUE;
},
previousAiring: function(item, direction) {
const previousAiring = item.previousAiring;
if (previousAiring) {
return moment(previousAiring).unix();
}
if (direction === sortDirections.DESCENDING) {
return -Number.MAX_VALUE;
}
return Number.MAX_VALUE;
},
episodeProgress: function(item) {
const { statistics = {} } = item;