Misc History Improvements

This commit is contained in:
Qstick
2020-10-23 01:09:34 -04:00
parent eca9b87571
commit 4b66d99029
32 changed files with 280 additions and 904 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { createAction } from 'redux-actions';
import Icon from 'Components/Icon';
import { filterBuilderTypes, filterBuilderValueTypes, filterTypes, icons, sortDirections } from 'Helpers/Props';
import { filterBuilderTypes, filterBuilderValueTypes, icons, sortDirections } from 'Helpers/Props';
import { createThunk, handleThunks } from 'Store/thunks';
import createAjaxRequest from 'Utilities/createAjaxRequest';
import translate from 'Utilities/String/translate';
@@ -100,17 +100,6 @@ export const defaultState = {
return releaseWeight + 1000000;
}
return releaseWeight;
},
rejections: function(item, direction) {
const rejections = item.rejections;
const releaseWeight = item.releaseWeight;
if (rejections.length !== 0) {
return releaseWeight + 1000000;
}
return releaseWeight;
}
},
@@ -123,50 +112,6 @@ export const defaultState = {
}
],
filterPredicates: {
quality: function(item, value, type) {
const qualityId = item.quality.quality.id;
if (type === filterTypes.EQUAL) {
return qualityId === value;
}
if (type === filterTypes.NOT_EQUAL) {
return qualityId !== value;
}
// Default to false
return false;
},
rejectionCount: function(item, value, type) {
const rejectionCount = item.rejections.length;
switch (type) {
case filterTypes.EQUAL:
return rejectionCount === value;
case filterTypes.GREATER_THAN:
return rejectionCount > value;
case filterTypes.GREATER_THAN_OR_EQUAL:
return rejectionCount >= value;
case filterTypes.LESS_THAN:
return rejectionCount < value;
case filterTypes.LESS_THAN_OR_EQUAL:
return rejectionCount <= value;
case filterTypes.NOT_EQUAL:
return rejectionCount !== value;
default:
return false;
}
}
},
filterBuilderProps: [
{
name: 'title',
@@ -204,17 +149,6 @@ export const defaultState = {
name: 'peers',
label: translate('Peers'),
type: filterBuilderTypes.NUMBER
},
{
name: 'quality',
label: translate('Quality'),
type: filterBuilderTypes.EXACT,
valueType: filterBuilderValueTypes.QUALITY
},
{
name: 'rejectionCount',
label: translate('RejectionCount'),
type: filterBuilderTypes.NUMBER
}
],
selectedFilterKey: 'all'
@@ -235,7 +169,7 @@ export const SET_RELEASES_SORT = 'releases/setReleasesSort';
export const CLEAR_RELEASES = 'releases/clearReleases';
export const GRAB_RELEASE = 'releases/grabRelease';
export const UPDATE_RELEASE = 'releases/updateRelease';
export const SET_RELEASES_FILTER = 'releases/setMovieReleasesFilter';
export const SET_RELEASES_FILTER = 'releases/setReleasesFilter';
export const SET_RELEASES_TABLE_OPTION = 'releases/setReleasesTableOption';
//