mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-02-04 11:43:19 +02:00
Series type filter/sort
New: Filter/sort by series type Fixed: Filtering excluding multiple values (is not x or y)
This commit is contained in:
parent
3b565d8bb1
commit
ba5e2cfc45
@ -8,4 +8,5 @@ export const PROTOCOL = 'protocol';
|
|||||||
export const QUALITY = 'quality';
|
export const QUALITY = 'quality';
|
||||||
export const QUALITY_PROFILE = 'qualityProfile';
|
export const QUALITY_PROFILE = 'qualityProfile';
|
||||||
export const SERIES_STATUS = 'seriesStatus';
|
export const SERIES_STATUS = 'seriesStatus';
|
||||||
|
export const SERIES_TYPES = 'seriesType';
|
||||||
export const TAG = 'tag';
|
export const TAG = 'tag';
|
||||||
|
@ -14,6 +14,12 @@
|
|||||||
flex: 0 0 379px;
|
flex: 0 0 379px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.seriesType {
|
||||||
|
composes: headerCell from 'Components/Table/VirtualTableHeaderCell.css';
|
||||||
|
|
||||||
|
flex: 0 0 100px;
|
||||||
|
}
|
||||||
|
|
||||||
.network {
|
.network {
|
||||||
composes: headerCell from 'Components/Table/VirtualTableHeaderCell.css';
|
composes: headerCell from 'Components/Table/VirtualTableHeaderCell.css';
|
||||||
|
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
flex: 4 0 110px;
|
flex: 4 0 110px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.seriesType {
|
||||||
|
composes: cell;
|
||||||
|
|
||||||
|
flex: 0 0 100px;
|
||||||
|
}
|
||||||
|
|
||||||
.banner {
|
.banner {
|
||||||
flex: 0 0 379px;
|
flex: 0 0 379px;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
|
|
||||||
import formatBytes from 'Utilities/Number/formatBytes';
|
import formatBytes from 'Utilities/Number/formatBytes';
|
||||||
|
import getProgressBarKind from 'Utilities/Series/getProgressBarKind';
|
||||||
|
import titleCase from 'Utilities/String/titleCase';
|
||||||
import { icons } from 'Helpers/Props';
|
import { icons } from 'Helpers/Props';
|
||||||
import HeartRating from 'Components/HeartRating';
|
import HeartRating from 'Components/HeartRating';
|
||||||
import IconButton from 'Components/Link/IconButton';
|
import IconButton from 'Components/Link/IconButton';
|
||||||
@ -83,6 +84,7 @@ class SeriesIndexRow extends Component {
|
|||||||
status,
|
status,
|
||||||
title,
|
title,
|
||||||
titleSlug,
|
titleSlug,
|
||||||
|
seriesType,
|
||||||
network,
|
network,
|
||||||
qualityProfile,
|
qualityProfile,
|
||||||
languageProfile,
|
languageProfile,
|
||||||
@ -187,6 +189,17 @@ class SeriesIndexRow extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (name === 'seriesType') {
|
||||||
|
return (
|
||||||
|
<VirtualTableRowCell
|
||||||
|
key={name}
|
||||||
|
className={styles[name]}
|
||||||
|
>
|
||||||
|
{titleCase(seriesType)}
|
||||||
|
</VirtualTableRowCell>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (name === 'network') {
|
if (name === 'network') {
|
||||||
return (
|
return (
|
||||||
<VirtualTableRowCell
|
<VirtualTableRowCell
|
||||||
@ -477,6 +490,7 @@ SeriesIndexRow.propTypes = {
|
|||||||
status: PropTypes.string.isRequired,
|
status: PropTypes.string.isRequired,
|
||||||
title: PropTypes.string.isRequired,
|
title: PropTypes.string.isRequired,
|
||||||
titleSlug: PropTypes.string.isRequired,
|
titleSlug: PropTypes.string.isRequired,
|
||||||
|
seriesType: PropTypes.string.isRequired,
|
||||||
network: PropTypes.string,
|
network: PropTypes.string,
|
||||||
qualityProfile: PropTypes.object.isRequired,
|
qualityProfile: PropTypes.object.isRequired,
|
||||||
languageProfile: PropTypes.object.isRequired,
|
languageProfile: PropTypes.object.isRequired,
|
||||||
|
@ -66,6 +66,12 @@ export const defaultState = {
|
|||||||
isVisible: true,
|
isVisible: true,
|
||||||
isModifiable: false
|
isModifiable: false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'seriesType',
|
||||||
|
label: 'Type',
|
||||||
|
isSortable: true,
|
||||||
|
isVisible: false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'network',
|
name: 'network',
|
||||||
label: 'Network',
|
label: 'Network',
|
||||||
@ -255,6 +261,12 @@ export const defaultState = {
|
|||||||
type: filterBuilderTypes.EXACT,
|
type: filterBuilderTypes.EXACT,
|
||||||
valueType: filterBuilderValueTypes.SERIES_STATUS
|
valueType: filterBuilderValueTypes.SERIES_STATUS
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'seriesType',
|
||||||
|
label: 'Type',
|
||||||
|
type: filterBuilderTypes.EXACT,
|
||||||
|
valueType: filterBuilderValueTypes.SERIES_TYPES
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'network',
|
name: 'network',
|
||||||
label: 'Network',
|
label: 'Network',
|
||||||
|
@ -52,7 +52,14 @@ function filter(items, state) {
|
|||||||
const predicate = filterTypePredicates[type];
|
const predicate = filterTypePredicates[type];
|
||||||
|
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
accepted = value.some((v) => predicate(item[key], v));
|
if (
|
||||||
|
type === filterTypes.NOT_CONTAINS ||
|
||||||
|
type === filterTypes.NOT_EQUAL
|
||||||
|
) {
|
||||||
|
accepted = value.every((v) => predicate(item[key], v));
|
||||||
|
} else {
|
||||||
|
accepted = value.some((v) => predicate(item[key], v));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
accepted = predicate(item[key], value);
|
accepted = predicate(item[key], value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user