Parse Files and Grabs in Release Info

This commit is contained in:
Qstick
2020-12-28 21:40:54 -05:00
parent e2a46820da
commit a041fc0d4b
8 changed files with 89 additions and 4 deletions

View File

@@ -24,6 +24,8 @@
.age,
.size,
.files,
.grabs,
.peers {
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';

View File

@@ -31,6 +31,8 @@
.age,
.size,
.files,
.grabs,
.peers {
composes: cell;

View File

@@ -32,6 +32,8 @@ class SearchIndexRow extends Component {
infoUrl,
indexer,
size,
files,
grabs,
seeders,
leechers,
indexerFlags,
@@ -117,6 +119,28 @@ class SearchIndexRow extends Component {
);
}
if (column.name === 'files') {
return (
<VirtualTableRowCell
key={column.name}
className={styles[column.name]}
>
{files}
</VirtualTableRowCell>
);
}
if (column.name === 'grabs') {
return (
<VirtualTableRowCell
key={column.name}
className={styles[column.name]}
>
{grabs}
</VirtualTableRowCell>
);
}
if (column.name === 'peers') {
return (
<VirtualTableRowCell
@@ -218,6 +242,8 @@ SearchIndexRow.propTypes = {
indexerId: PropTypes.number.isRequired,
indexer: PropTypes.string.isRequired,
size: PropTypes.number.isRequired,
files: PropTypes.number,
grabs: PropTypes.number,
seeders: PropTypes.number,
leechers: PropTypes.number,
indexerFlags: PropTypes.arrayOf(PropTypes.string).isRequired,

View File

@@ -1,7 +1,5 @@
import React from 'react';
import { createAction } from 'redux-actions';
import Icon from 'Components/Icon';
import { filterBuilderTypes, filterBuilderValueTypes, icons, sortDirections } from 'Helpers/Props';
import { filterBuilderTypes, filterBuilderValueTypes, sortDirections } from 'Helpers/Props';
import { createThunk, handleThunks } from 'Store/thunks';
import createAjaxRequest from 'Utilities/createAjaxRequest';
import translate from 'Utilities/String/translate';
@@ -60,6 +58,18 @@ export const defaultState = {
isSortable: true,
isVisible: true
},
{
name: 'files',
label: translate('Files'),
isSortable: true,
isVisible: false
},
{
name: 'grabs',
label: translate('Grabs'),
isSortable: true,
isVisible: true
},
{
name: 'peers',
label: translate('Peers'),
@@ -74,7 +84,6 @@ export const defaultState = {
},
{
name: 'indexerFlags',
label: React.createElement(Icon, { name: icons.FLAG }),
columnLabel: 'Indexer Flags',
isSortable: true,
isVisible: true
@@ -146,6 +155,16 @@ export const defaultState = {
label: translate('Size'),
type: filterBuilderTypes.NUMBER
},
{
name: 'files',
label: translate('Files'),
type: filterBuilderTypes.NUMBER
},
{
name: 'grabs',
label: translate('Grabs'),
type: filterBuilderTypes.NUMBER
},
{
name: 'seeders',
label: translate('Seeders'),