mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 08:19:38 +02:00
Fixed: Sort qualities by name within group when sorting by status
Relates to #4189, Optimal end state would be to sort by quality weight within group, however that is not currently passed from API with the quality object.
This commit is contained in:
parent
64e9e48217
commit
7173c5c737
@ -3,6 +3,7 @@ import { createAction } from 'redux-actions';
|
||||
// import { batchActions } from 'redux-batched-actions';
|
||||
import createAjaxRequest from 'Utilities/createAjaxRequest';
|
||||
import dateFilterPredicate from 'Utilities/Date/dateFilterPredicate';
|
||||
import padNumber from 'Utilities/Number/padNumber';
|
||||
import { filterTypePredicates, filterTypes, sortDirections } from 'Helpers/Props';
|
||||
import { createThunk, handleThunks } from 'Store/thunks';
|
||||
import createSetSettingValueReducer from './Creators/Reducers/createSetSettingValueReducer';
|
||||
@ -163,9 +164,18 @@ export const sortPredicates = {
|
||||
|
||||
movieStatus: function(item) {
|
||||
let result = 0;
|
||||
let qualityName = '';
|
||||
|
||||
const hasMovieFile = !!item.movieFile;
|
||||
|
||||
if (item.isAvailable && item.inCinemas) {
|
||||
result++;
|
||||
}
|
||||
|
||||
if (item.monitored) {
|
||||
result += 2;
|
||||
}
|
||||
|
||||
if (hasMovieFile) {
|
||||
// TODO: Consider Quality Weight for Sorting within status of hasMovie
|
||||
if (item.movieFile.qualityCutoffNotMet) {
|
||||
@ -173,17 +183,10 @@ export const sortPredicates = {
|
||||
} else {
|
||||
result += 8;
|
||||
}
|
||||
qualityName = item.movieFile.quality.quality.name;
|
||||
}
|
||||
|
||||
if (item.isAvailable) {
|
||||
result++;
|
||||
}
|
||||
|
||||
if (item.monitored) {
|
||||
result += 2;
|
||||
}
|
||||
|
||||
return result;
|
||||
return padNumber(result.toString(), 2) + qualityName;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user