diff --git a/frontend/src/Store/Actions/seriesIndexActions.js b/frontend/src/Store/Actions/seriesIndexActions.js index a953652b6..ffdab4bfa 100644 --- a/frontend/src/Store/Actions/seriesIndexActions.js +++ b/frontend/src/Store/Actions/seriesIndexActions.js @@ -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;