diff --git a/frontend/src/Store/Actions/movieActions.js b/frontend/src/Store/Actions/movieActions.js index 43e2375e0..9d557365d 100644 --- a/frontend/src/Store/Actions/movieActions.js +++ b/frontend/src/Store/Actions/movieActions.js @@ -151,6 +151,31 @@ export const sortPredicates = { result += 3; } + return result; + }, + + movieStatus: function(item) { + let result = 0; + + const hasMovieFile = !!item.movieFile; + + if (hasMovieFile) { + // TODO: Consider Quality Weight for Sorting within status of hasMovie + if (item.movieFile.qualityCutoffNotMet) { + result += 4; + } else { + result += 8; + } + } + + if (item.isAvailable) { + result++; + } + + if (item.monitored) { + result += 2; + } + return result; } };