Rename ImportExclusions to ImportListExclusions

pull/10287/head
Bogdan 3 months ago committed by Qstick
parent f75497f57d
commit d25bcdb043

@ -6,7 +6,7 @@ import { clearAddMovie, lookupMovie } from 'Store/Actions/addMovieActions';
import { clearMovieFiles, fetchMovieFiles } from 'Store/Actions/movieFileActions';
import { clearQueueDetails, fetchQueueDetails } from 'Store/Actions/queueActions';
import { fetchRootFolders } from 'Store/Actions/rootFolderActions';
import { fetchImportExclusions } from 'Store/Actions/Settings/importExclusions';
import { fetchImportListExclusions } from 'Store/Actions/Settings/importListExclusions';
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import selectUniqueIds from 'Utilities/Object/selectUniqueIds';
@ -36,7 +36,7 @@ const mapDispatchToProps = {
lookupMovie,
clearAddMovie,
fetchRootFolders,
fetchImportExclusions,
fetchImportListExclusions,
fetchQueueDetails,
clearQueueDetails,
fetchMovieFiles,
@ -56,7 +56,7 @@ class AddNewMovieConnector extends Component {
componentDidMount() {
this.props.fetchRootFolders();
this.props.fetchImportExclusions();
this.props.fetchImportListExclusions();
this.props.fetchQueueDetails();
}
@ -131,7 +131,7 @@ AddNewMovieConnector.propTypes = {
lookupMovie: PropTypes.func.isRequired,
clearAddMovie: PropTypes.func.isRequired,
fetchRootFolders: PropTypes.func.isRequired,
fetchImportExclusions: PropTypes.func.isRequired,
fetchImportListExclusions: PropTypes.func.isRequired,
fetchQueueDetails: PropTypes.func.isRequired,
clearQueueDetails: PropTypes.func.isRequired,
fetchMovieFiles: PropTypes.func.isRequired,

@ -5,9 +5,9 @@ import { createSelector } from 'reselect';
import * as commandNames from 'Commands/commandNames';
import withScrollPosition from 'Components/withScrollPosition';
import { executeCommand } from 'Store/Actions/commandActions';
import { addImportExclusions, addMovies, clearAddMovie, fetchDiscoverMovies, setListMovieFilter, setListMovieSort, setListMovieTableOption, setListMovieView } from 'Store/Actions/discoverMovieActions';
import { addImportListExclusions, addMovies, clearAddMovie, fetchDiscoverMovies, setListMovieFilter, setListMovieSort, setListMovieTableOption, setListMovieView } from 'Store/Actions/discoverMovieActions';
import { fetchRootFolders } from 'Store/Actions/rootFolderActions';
import { fetchImportExclusions } from 'Store/Actions/Settings/importExclusions';
import { fetchImportListExclusions } from 'Store/Actions/Settings/importListExclusions';
import scrollPositions from 'Store/scrollPositions';
import createCommandExecutingSelector from 'Store/Selectors/createCommandExecutingSelector';
import createDimensionsSelector from 'Store/Selectors/createDimensionsSelector';
@ -43,8 +43,8 @@ function createMapDispatchToProps(dispatch, props) {
dispatch(fetchRootFolders());
},
dispatchFetchImportExclusions() {
dispatch(fetchImportExclusions());
dispatchFetchImportListExclusions() {
dispatch(fetchImportListExclusions());
},
dispatchClearListMovie() {
@ -75,8 +75,8 @@ function createMapDispatchToProps(dispatch, props) {
dispatch(addMovies({ ids, addOptions }));
},
dispatchAddImportExclusions(exclusions) {
dispatch(addImportExclusions(exclusions));
dispatchAddImportListExclusions(exclusions) {
dispatch(addImportListExclusions(exclusions));
},
onImportListSyncPress() {
@ -96,7 +96,7 @@ class DiscoverMovieConnector extends Component {
componentDidMount() {
registerPagePopulator(this.repopulate);
this.props.dispatchFetchRootFolders();
this.props.dispatchFetchImportExclusions();
this.props.dispatchFetchImportListExclusions();
this.props.dispatchFetchListMovies();
}
@ -121,7 +121,7 @@ class DiscoverMovieConnector extends Component {
};
onExcludeMoviesPress =({ ids }) => {
this.props.dispatchAddImportExclusions({ ids });
this.props.dispatchAddImportListExclusions({ ids });
};
//
@ -144,13 +144,13 @@ class DiscoverMovieConnector extends Component {
DiscoverMovieConnector.propTypes = {
isSmallScreen: PropTypes.bool.isRequired,
view: PropTypes.string.isRequired,
dispatchFetchImportExclusions: PropTypes.func.isRequired,
dispatchFetchImportListExclusions: PropTypes.func.isRequired,
dispatchFetchRootFolders: PropTypes.func.isRequired,
dispatchFetchListMovies: PropTypes.func.isRequired,
dispatchClearListMovie: PropTypes.func.isRequired,
dispatchSetListMovieView: PropTypes.func.isRequired,
dispatchAddMovies: PropTypes.func.isRequired,
dispatchAddImportExclusions: PropTypes.func.isRequired
dispatchAddImportListExclusions: PropTypes.func.isRequired
};
export default withScrollPosition(

@ -8,9 +8,9 @@ import DiscoverMovieFooter from './DiscoverMovieFooter';
function createMapStateToProps() {
return createSelector(
(state) => state.discoverMovie,
(state) => state.settings.importExclusions,
(state) => state.settings.importListExclusions,
(state, { selectedIds }) => selectedIds,
(discoverMovie, importExclusions, selectedIds) => {
(discoverMovie, importListExclusions, selectedIds) => {
const {
monitor: defaultMonitor,
qualityProfileId: defaultQualityProfileId,
@ -25,7 +25,7 @@ function createMapStateToProps() {
const {
isSaving
} = importExclusions;
} = importListExclusions;
return {
selectedCount: selectedIds.length,

@ -1,11 +1,11 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { addImportExclusions } from 'Store/Actions/discoverMovieActions';
import { addImportListExclusions } from 'Store/Actions/discoverMovieActions';
import ExcludeMovieModalContent from './ExcludeMovieModalContent';
const mapDispatchToProps = {
addImportExclusions
addImportListExclusions
};
class ExcludeMovieModalContentConnector extends Component {
@ -14,7 +14,7 @@ class ExcludeMovieModalContentConnector extends Component {
// Listeners
onExcludePress = () => {
this.props.addImportExclusions({ ids: [this.props.tmdbId] });
this.props.addImportListExclusions({ ids: [this.props.tmdbId] });
this.props.onModalClose(true);
};
@ -37,7 +37,7 @@ ExcludeMovieModalContentConnector.propTypes = {
title: PropTypes.string.isRequired,
year: PropTypes.number.isRequired,
onModalClose: PropTypes.func.isRequired,
addImportExclusions: PropTypes.func.isRequired
addImportListExclusions: PropTypes.func.isRequired
};
export default connect(undefined, mapDispatchToProps)(ExcludeMovieModalContentConnector);

@ -18,7 +18,7 @@ class EditImportListExclusionModalConnector extends Component {
// Listeners
onModalClose = () => {
this.props.clearPendingChanges({ section: 'settings.importExclusions' });
this.props.clearPendingChanges({ section: 'settings.importListExclusions' });
this.props.onModalClose();
};

@ -27,7 +27,7 @@ function EditImportListExclusionModalContent(props) {
onInputChange,
onSavePress,
onModalClose,
onDeleteImportExclusionPress,
onDeleteImportListExclusionPress,
...otherProps
} = props;
@ -107,7 +107,7 @@ function EditImportListExclusionModalContent(props) {
<Button
className={styles.deleteButton}
kind={kinds.DANGER}
onPress={onDeleteImportExclusionPress}
onPress={onDeleteImportListExclusionPress}
>
{translate('Delete')}
</Button>
@ -141,7 +141,7 @@ EditImportListExclusionModalContent.propTypes = {
onInputChange: PropTypes.func.isRequired,
onSavePress: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired,
onDeleteImportExclusionPress: PropTypes.func
onDeleteImportListExclusionPress: PropTypes.func
};
export default EditImportListExclusionModalContent;

@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { saveImportExclusion, setImportExclusionValue } from 'Store/Actions/settingsActions';
import { saveImportListExclusion, setImportListExclusionValue } from 'Store/Actions/settingsActions';
import selectSettings from 'Store/Selectors/selectSettings';
import EditImportListExclusionModalContent from './EditImportListExclusionModalContent';
@ -12,11 +12,11 @@ const newImportListExclusion = {
movieYear: 0
};
function createImportExclusionSelector() {
function createImportListExclusionSelector() {
return createSelector(
(state, { id }) => id,
(state) => state.settings.importExclusions,
(id, importExclusions) => {
(state) => state.settings.importListExclusions,
(id, importListExclusions) => {
const {
isFetching,
error,
@ -24,7 +24,7 @@ function createImportExclusionSelector() {
saveError,
pendingChanges,
items
} = importExclusions;
} = importListExclusions;
const mapping = id ? items.find((i) => i.id === id) : newImportListExclusion;
const settings = selectSettings(mapping, pendingChanges, saveError);
@ -44,21 +44,21 @@ function createImportExclusionSelector() {
function createMapStateToProps() {
return createSelector(
createImportExclusionSelector(),
(importExclusion) => {
createImportListExclusionSelector(),
(importListExclusion) => {
return {
...importExclusion
...importListExclusion
};
}
);
}
const mapDispatchToProps = {
setImportExclusionValue,
saveImportExclusion
setImportListExclusionValue,
saveImportListExclusion
};
class EditImportExclusionModalContentConnector extends Component {
class EditImportListExclusionModalContentConnector extends Component {
//
// Lifecycle
@ -66,7 +66,7 @@ class EditImportExclusionModalContentConnector extends Component {
componentDidMount() {
if (!this.props.id) {
Object.keys(newImportListExclusion).forEach((name) => {
this.props.setImportExclusionValue({
this.props.setImportListExclusionValue({
name,
value: newImportListExclusion[name]
});
@ -84,11 +84,11 @@ class EditImportExclusionModalContentConnector extends Component {
// Listeners
onInputChange = ({ name, value }) => {
this.props.setImportExclusionValue({ name, value });
this.props.setImportListExclusionValue({ name, value });
};
onSavePress = () => {
this.props.saveImportExclusion({ id: this.props.id });
this.props.saveImportListExclusion({ id: this.props.id });
};
//
@ -105,14 +105,14 @@ class EditImportExclusionModalContentConnector extends Component {
}
}
EditImportExclusionModalContentConnector.propTypes = {
EditImportListExclusionModalContentConnector.propTypes = {
id: PropTypes.number,
isSaving: PropTypes.bool.isRequired,
saveError: PropTypes.object,
item: PropTypes.object.isRequired,
setImportExclusionValue: PropTypes.func.isRequired,
saveImportExclusion: PropTypes.func.isRequired,
setImportListExclusionValue: PropTypes.func.isRequired,
saveImportListExclusion: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(EditImportExclusionModalContentConnector);
export default connect(createMapStateToProps, mapDispatchToProps)(EditImportListExclusionModalContentConnector);

@ -1,4 +1,4 @@
.importExclusion {
.importListExclusion {
display: flex;
align-items: stretch;
margin-bottom: 10px;

@ -2,7 +2,7 @@
// Please do not change this file!
interface CssExports {
'actions': string;
'importExclusion': string;
'importListExclusion': string;
'movieTitle': string;
'movieYear': string;
'tmdbId': string;

@ -18,35 +18,35 @@ class ImportListExclusion extends Component {
super(props, context);
this.state = {
isEditImportExclusionModalOpen: false,
isDeleteImportExclusionModalOpen: false
isEditImportListExclusionModalOpen: false,
isDeleteImportListExclusionModalOpen: false
};
}
//
// Listeners
onEditImportExclusionPress = () => {
this.setState({ isEditImportExclusionModalOpen: true });
onEditImportListExclusionPress = () => {
this.setState({ isEditImportListExclusionModalOpen: true });
};
onEditImportExclusionModalClose = () => {
this.setState({ isEditImportExclusionModalOpen: false });
onEditImportListExclusionModalClose = () => {
this.setState({ isEditImportListExclusionModalOpen: false });
};
onDeleteImportExclusionPress = () => {
onDeleteImportListExclusionPress = () => {
this.setState({
isEditImportExclusionModalOpen: false,
isDeleteImportExclusionModalOpen: true
isEditImportListExclusionModalOpen: false,
isDeleteImportListExclusionModalOpen: true
});
};
onDeleteImportExclusionModalClose = () => {
this.setState({ isDeleteImportExclusionModalOpen: false });
onDeleteImportListExclusionModalClose = () => {
this.setState({ isDeleteImportListExclusionModalOpen: false });
};
onConfirmDeleteImportExclusion = () => {
this.props.onConfirmDeleteImportExclusion(this.props.id);
onConfirmDeleteImportListExclusion = () => {
this.props.onConfirmDeleteImportListExclusion(this.props.id);
};
//
@ -63,7 +63,7 @@ class ImportListExclusion extends Component {
return (
<div
className={classNames(
styles.importExclusion
styles.importListExclusion
)}
>
<div className={styles.tmdbId}>{tmdbId}</div>
@ -72,7 +72,7 @@ class ImportListExclusion extends Component {
<div className={styles.actions}>
<Link
onPress={this.onEditImportExclusionPress}
onPress={this.onEditImportListExclusionPress}
>
<Icon name={icons.EDIT} />
</Link>
@ -80,19 +80,19 @@ class ImportListExclusion extends Component {
<EditImportListExclusionModalConnector
id={id}
isOpen={this.state.isEditImportExclusionModalOpen}
onModalClose={this.onEditImportExclusionModalClose}
onDeleteImportExclusionPress={this.onDeleteImportExclusionPress}
isOpen={this.state.isEditImportListExclusionModalOpen}
onModalClose={this.onEditImportListExclusionModalClose}
onDeleteImportListExclusionPress={this.onDeleteImportListExclusionPress}
/>
<ConfirmModal
isOpen={this.state.isDeleteImportExclusionModalOpen}
isOpen={this.state.isDeleteImportListExclusionModalOpen}
kind={kinds.DANGER}
title={translate('DeleteImportListExclusion')}
message={translate('DeleteImportListExclusionMessageText')}
confirmLabel={translate('Delete')}
onConfirm={this.onConfirmDeleteImportExclusion}
onCancel={this.onDeleteImportExclusionModalClose}
onConfirm={this.onConfirmDeleteImportListExclusion}
onCancel={this.onDeleteImportListExclusionModalClose}
/>
</div>
);
@ -104,7 +104,7 @@ ImportListExclusion.propTypes = {
movieTitle: PropTypes.string.isRequired,
tmdbId: PropTypes.number.isRequired,
movieYear: PropTypes.number.isRequired,
onConfirmDeleteImportExclusion: PropTypes.func.isRequired
onConfirmDeleteImportListExclusion: PropTypes.func.isRequired
};
ImportListExclusion.defaultProps = {

@ -13,7 +13,7 @@
flex: 0 0 70px;
}
.addImportExclusion {
.addImportListExclusion {
display: flex;
justify-content: flex-end;
padding-right: 10px;

@ -2,7 +2,7 @@
// Please do not change this file!
interface CssExports {
'addButton': string;
'addImportExclusion': string;
'addImportListExclusion': string;
'importListExclusionsHeader': string;
'movieYear': string;
'title': string;

@ -19,19 +19,19 @@ class ImportListExclusions extends Component {
super(props, context);
this.state = {
isAddImportExclusionModalOpen: false
isAddImportListExclusionModalOpen: false
};
}
//
// Listeners
onAddImportExclusionPress = () => {
this.setState({ isAddImportExclusionModalOpen: true });
onAddImportListExclusionPress = () => {
this.setState({ isAddImportListExclusionModalOpen: true });
};
onModalClose = () => {
this.setState({ isAddImportExclusionModalOpen: false });
this.setState({ isAddImportListExclusionModalOpen: false });
};
//
@ -40,7 +40,7 @@ class ImportListExclusions extends Component {
render() {
const {
items,
onConfirmDeleteImportExclusion,
onConfirmDeleteImportListExclusion,
...otherProps
} = this.props;
@ -71,24 +71,24 @@ class ImportListExclusions extends Component {
{...item}
{...otherProps}
index={index}
onConfirmDeleteImportExclusion={onConfirmDeleteImportExclusion}
onConfirmDeleteImportListExclusion={onConfirmDeleteImportListExclusion}
/>
);
})
}
</div>
<div className={styles.addImportExclusion}>
<div className={styles.addImportListExclusion}>
<Link
className={styles.addButton}
onPress={this.onAddImportExclusionPress}
onPress={this.onAddImportListExclusionPress}
>
<Icon name={icons.ADD} />
</Link>
</div>
<EditImportListExclusionModalConnector
isOpen={this.state.isAddImportExclusionModalOpen}
isOpen={this.state.isAddImportListExclusionModalOpen}
onModalClose={this.onModalClose}
/>
@ -102,7 +102,7 @@ ImportListExclusions.propTypes = {
isFetching: PropTypes.bool.isRequired,
error: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
onConfirmDeleteImportExclusion: PropTypes.func.isRequired
onConfirmDeleteImportListExclusion: PropTypes.func.isRequired
};
export default ImportListExclusions;

@ -2,39 +2,39 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { deleteImportExclusion, fetchImportExclusions } from 'Store/Actions/settingsActions';
import { deleteImportListExclusion, fetchImportListExclusions } from 'Store/Actions/settingsActions';
import ImportListExclusions from './ImportListExclusions';
function createMapStateToProps() {
return createSelector(
(state) => state.settings.importExclusions,
(importExclusions) => {
(state) => state.settings.importListExclusions,
(importListExclusions) => {
return {
...importExclusions
...importListExclusions
};
}
);
}
const mapDispatchToProps = {
fetchImportExclusions,
deleteImportExclusion
fetchImportListExclusions,
deleteImportListExclusion
};
class ImportExclusionsConnector extends Component {
class ImportListExclusionsConnector extends Component {
//
// Lifecycle
componentDidMount() {
this.props.fetchImportExclusions();
this.props.fetchImportListExclusions();
}
//
// Listeners
onConfirmDeleteImportExclusion = (id) => {
this.props.deleteImportExclusion({ id });
onConfirmDeleteImportListExclusion = (id) => {
this.props.deleteImportListExclusion({ id });
};
//
@ -45,15 +45,15 @@ class ImportExclusionsConnector extends Component {
<ImportListExclusions
{...this.state}
{...this.props}
onConfirmDeleteImportExclusion={this.onConfirmDeleteImportExclusion}
onConfirmDeleteImportListExclusion={this.onConfirmDeleteImportListExclusion}
/>
);
}
}
ImportExclusionsConnector.propTypes = {
fetchImportExclusions: PropTypes.func.isRequired,
deleteImportExclusion: PropTypes.func.isRequired
ImportListExclusionsConnector.propTypes = {
fetchImportListExclusions: PropTypes.func.isRequired,
deleteImportListExclusion: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(ImportExclusionsConnector);
export default connect(createMapStateToProps, mapDispatchToProps)(ImportListExclusionsConnector);

@ -60,7 +60,7 @@ class ImportListSettings extends Component {
render() {
const {
isTestingAll,
dispatchTestAllImportList
dispatchTestAllImportLists
} = this.props;
const {
@ -82,7 +82,7 @@ class ImportListSettings extends Component {
label={translate('TestAllLists')}
iconName={icons.TEST}
isSpinning={isTestingAll}
onPress={dispatchTestAllImportList}
onPress={dispatchTestAllImportLists}
/>
<PageToolbarButton
@ -118,7 +118,7 @@ class ImportListSettings extends Component {
ImportListSettings.propTypes = {
isTestingAll: PropTypes.bool.isRequired,
dispatchTestAllImportList: PropTypes.func.isRequired
dispatchTestAllImportLists: PropTypes.func.isRequired
};
export default ImportListSettings;

@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { testAllImportList } from 'Store/Actions/settingsActions';
import { testAllImportLists } from 'Store/Actions/settingsActions';
import ImportListSettings from './ImportListSettings';
function createMapStateToProps() {
@ -15,7 +15,7 @@ function createMapStateToProps() {
}
const mapDispatchToProps = {
dispatchTestAllImportList: testAllImportList
dispatchTestAllImportLists: testAllImportLists
};
export default connect(createMapStateToProps, mapDispatchToProps)(ImportListSettings);

@ -1,4 +1,4 @@
.importList {
.list {
composes: card from '~Components/Card.css';
position: relative;

@ -2,7 +2,7 @@
// Please do not change this file!
interface CssExports {
'actions': string;
'importList': string;
'list': string;
'name': string;
'overlay': string;
'presetsMenu': string;

@ -41,7 +41,7 @@ class AddImportListItem extends Component {
return (
<div
className={styles.importList}
className={styles.list}
>
<Link
className={styles.underlay}

@ -1,4 +1,4 @@
.importLists {
.lists {
display: flex;
justify-content: center;
flex-wrap: wrap;

@ -1,7 +1,7 @@
// This file is automatically generated.
// Please do not change this file!
interface CssExports {
'importLists': string;
'lists': string;
}
export const cssExports: CssExports;
export default cssExports;

@ -69,7 +69,7 @@ class AddImportListModalContent extends Component {
typeOfList: titleCase(key)
})}
>
<div className={styles.importLists}>
<div className={styles.lists}>
{
listGroups[key].map((list) => {
return (

@ -51,7 +51,7 @@ class AddImportListModalContentConnector extends Component {
onImportListSelect = ({ implementation, implementationName, name, minRefreshInterval }) => {
this.props.selectImportListSchema({ implementation, implementationName, presetName: name, minRefreshInterval });
this.props.onModalClose({ importListSelected: true });
this.props.onModalClose({ listSelected: true });
};
//

@ -1,4 +1,4 @@
.importList {
.list {
composes: card from '~Components/Card.css';
width: 290px;

@ -2,7 +2,7 @@
// Please do not change this file!
interface CssExports {
'enabled': string;
'importList': string;
'list': string;
'name': string;
}
export const cssExports: CssExports;

@ -63,7 +63,7 @@ class ImportList extends Component {
return (
<Card
className={styles.importList}
className={styles.list}
overlayContent={true}
onPress={this.onEditImportListPress}
>

@ -1,10 +1,10 @@
.importLists {
.lists {
display: flex;
flex-wrap: wrap;
}
.addImportList {
composes: importList from '~./ImportList.css';
.addList {
composes: list from '~./ImportList.css';
background-color: var(--cardAlternateBackgroundColor);
color: var(--gray);

@ -1,9 +1,9 @@
// This file is automatically generated.
// Please do not change this file!
interface CssExports {
'addImportList': string;
'addList': string;
'center': string;
'importLists': string;
'lists': string;
}
export const cssExports: CssExports;
export default cssExports;

@ -32,10 +32,10 @@ class ImportLists extends Component {
this.setState({ isAddImportListModalOpen: true });
};
onAddImportListModalClose = ({ importListSelected = false } = {}) => {
onAddImportListModalClose = ({ listSelected = false } = {}) => {
this.setState({
isAddImportListModalOpen: false,
isEditImportListModalOpen: importListSelected
isEditImportListModalOpen: listSelected
});
};
@ -64,7 +64,7 @@ class ImportLists extends Component {
errorMessage={translate('ImportListsLoadError')}
{...otherProps}
>
<div className={styles.importLists}>
<div className={styles.lists}>
{
items.map((item) => {
return (
@ -78,7 +78,7 @@ class ImportLists extends Component {
}
<Card
className={styles.addImportList}
className={styles.addList}
onPress={this.onAddImportListPress}
>
<div className={styles.center}>

@ -1,71 +0,0 @@
import { createAction } from 'redux-actions';
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHandler';
import createSaveProviderHandler from 'Store/Actions/Creators/createSaveProviderHandler';
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
import { createThunk } from 'Store/thunks';
//
// Variables
const section = 'settings.importExclusions';
//
// Actions Types
export const FETCH_IMPORT_EXCLUSIONS = 'settings/importExclusions/fetchImportExclusions';
export const SAVE_IMPORT_EXCLUSION = 'settings/importExclusions/saveImportExclusion';
export const DELETE_IMPORT_EXCLUSION = 'settings/importExclusions/deleteImportExclusion';
export const SET_IMPORT_EXCLUSION_VALUE = 'settings/importExclusions/setImportExclusionValue';
//
// Action Creators
export const fetchImportExclusions = createThunk(FETCH_IMPORT_EXCLUSIONS);
export const saveImportExclusion = createThunk(SAVE_IMPORT_EXCLUSION);
export const deleteImportExclusion = createThunk(DELETE_IMPORT_EXCLUSION);
export const setImportExclusionValue = createAction(SET_IMPORT_EXCLUSION_VALUE, (payload) => {
return {
section,
...payload
};
});
//
// Details
export default {
//
// State
defaultState: {
isFetching: false,
isPopulated: false,
error: null,
items: [],
isSaving: false,
saveError: null,
pendingChanges: {}
},
//
// Action Handlers
actionHandlers: {
[FETCH_IMPORT_EXCLUSIONS]: createFetchHandler(section, '/exclusions'),
[SAVE_IMPORT_EXCLUSION]: createSaveProviderHandler(section, '/exclusions'),
[DELETE_IMPORT_EXCLUSION]: createRemoveItemHandler(section, '/exclusions')
},
//
// Reducers
reducers: {
[SET_IMPORT_EXCLUSION_VALUE]: createSetSettingValueReducer(section)
}
};

@ -0,0 +1,71 @@
import { createAction } from 'redux-actions';
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHandler';
import createSaveProviderHandler from 'Store/Actions/Creators/createSaveProviderHandler';
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
import { createThunk } from 'Store/thunks';
//
// Variables
const section = 'settings.importListExclusions';
//
// Actions Types
export const FETCH_IMPORT_LIST_EXCLUSIONS = 'settings/importListExclusions/fetchImportListExclusions';
export const SAVE_IMPORT_LIST_EXCLUSION = 'settings/importListExclusions/saveImportListExclusion';
export const DELETE_IMPORT_LIST_EXCLUSION = 'settings/importListExclusions/deleteImportListExclusion';
export const SET_IMPORT_LIST_EXCLUSION_VALUE = 'settings/importListExclusions/setImportListExclusionValue';
//
// Action Creators
export const fetchImportListExclusions = createThunk(FETCH_IMPORT_LIST_EXCLUSIONS);
export const saveImportListExclusion = createThunk(SAVE_IMPORT_LIST_EXCLUSION);
export const deleteImportListExclusion = createThunk(DELETE_IMPORT_LIST_EXCLUSION);
export const setImportListExclusionValue = createAction(SET_IMPORT_LIST_EXCLUSION_VALUE, (payload) => {
return {
section,
...payload
};
});
//
// Details
export default {
//
// State
defaultState: {
isFetching: false,
isPopulated: false,
error: null,
items: [],
isSaving: false,
saveError: null,
pendingChanges: {}
},
//
// Action Handlers
actionHandlers: {
[FETCH_IMPORT_LIST_EXCLUSIONS]: createFetchHandler(section, '/exclusions'),
[SAVE_IMPORT_LIST_EXCLUSION]: createSaveProviderHandler(section, '/exclusions'),
[DELETE_IMPORT_LIST_EXCLUSION]: createRemoveItemHandler(section, '/exclusions')
},
//
// Reducers
reducers: {
[SET_IMPORT_LIST_EXCLUSION_VALUE]: createSetSettingValueReducer(section)
}
};

@ -30,10 +30,10 @@ export const CANCEL_SAVE_IMPORT_LIST = 'settings/importLists/cancelSaveImportLis
export const DELETE_IMPORT_LIST = 'settings/importLists/deleteImportList';
export const TEST_IMPORT_LIST = 'settings/importLists/testImportList';
export const CANCEL_TEST_IMPORT_LIST = 'settings/importLists/cancelTestImportList';
export const TEST_ALL_IMPORT_LIST = 'settings/importLists/testAllImportList';
export const TEST_ALL_IMPORT_LISTS = 'settings/importLists/testAllImportLists';
export const BULK_DELETE_IMPORT_LISTS = 'settings/importlists/bulkDeleteImportLists';
export const BULK_EDIT_IMPORT_LISTS = 'settings/importlists/bulkEditImportLists';
export const BULK_DELETE_IMPORT_LISTS = 'settings/importLists/bulkDeleteImportLists';
export const BULK_EDIT_IMPORT_LISTS = 'settings/importLists/bulkEditImportLists';
//
// Action Creators
@ -47,7 +47,7 @@ export const cancelSaveImportList = createThunk(CANCEL_SAVE_IMPORT_LIST);
export const deleteImportList = createThunk(DELETE_IMPORT_LIST);
export const testImportList = createThunk(TEST_IMPORT_LIST);
export const cancelTestImportList = createThunk(CANCEL_TEST_IMPORT_LIST);
export const testAllImportList = createThunk(TEST_ALL_IMPORT_LIST);
export const testAllImportLists = createThunk(TEST_ALL_IMPORT_LISTS);
export const bulkDeleteImportLists = createThunk(BULK_DELETE_IMPORT_LISTS);
export const bulkEditImportLists = createThunk(BULK_EDIT_IMPORT_LISTS);
@ -105,7 +105,7 @@ export default {
[DELETE_IMPORT_LIST]: createRemoveItemHandler(section, '/importlist'),
[TEST_IMPORT_LIST]: createTestProviderHandler(section, '/importlist'),
[CANCEL_TEST_IMPORT_LIST]: createCancelTestProviderHandler(section),
[TEST_ALL_IMPORT_LIST]: createTestAllProvidersHandler(section, '/importlist'),
[TEST_ALL_IMPORT_LISTS]: createTestAllProvidersHandler(section, '/importlist'),
[BULK_DELETE_IMPORT_LISTS]: createBulkRemoveItemHandler(section, '/importlist/bulk'),
[BULK_EDIT_IMPORT_LISTS]: createBulkEditItemHandler(section, '/importlist/bulk')

@ -543,7 +543,7 @@ export const SET_LIST_MOVIE_TABLE_OPTION = 'discoverMovie/setListMovieTableOptio
export const SET_LIST_MOVIE_POSTER_OPTION = 'discoverMovie/setListMoviePosterOption';
export const SET_LIST_MOVIE_OVERVIEW_OPTION = 'discoverMovie/setListMovieOverviewOption';
export const ADD_IMPORT_EXCLUSIONS = 'discoverMovie/addImportExclusions';
export const ADD_IMPORT_LIST_EXCLUSIONS = 'discoverMovie/addImportListExclusions';
//
// Action Creators
@ -563,7 +563,7 @@ export const setListMovieTableOption = createAction(SET_LIST_MOVIE_TABLE_OPTION)
export const setListMoviePosterOption = createAction(SET_LIST_MOVIE_POSTER_OPTION);
export const setListMovieOverviewOption = createAction(SET_LIST_MOVIE_OVERVIEW_OPTION);
export const addImportExclusions = createThunk(ADD_IMPORT_EXCLUSIONS);
export const addImportListExclusions = createThunk(ADD_IMPORT_LIST_EXCLUSIONS);
export const setAddMovieValue = createAction(SET_ADD_MOVIE_VALUE, (payload) => {
return {
@ -726,7 +726,7 @@ export const actionHandlers = handleThunks({
});
},
[ADD_IMPORT_EXCLUSIONS]: function(getState, payload, dispatch) {
[ADD_IMPORT_LIST_EXCLUSIONS]: function(getState, payload, dispatch) {
const ids = payload.ids;
const items = getState().discoverMovie.items;
@ -754,7 +754,7 @@ export const actionHandlers = handleThunks({
promise.done((data) => {
dispatch(batchActions([
...data.map((item) => updateItem({ section: 'settings.importExclusions', ...item })),
...data.map((item) => updateItem({ section: 'settings.importListExclusions', ...item })),
...data.map((item) => updateItem({ section, id: item.tmdbId, isExcluded: true })),

@ -9,7 +9,7 @@ import delayProfiles from './Settings/delayProfiles';
import downloadClientOptions from './Settings/downloadClientOptions';
import downloadClients from './Settings/downloadClients';
import general from './Settings/general';
import importExclusions from './Settings/importExclusions';
import importListExclusions from './Settings/importListExclusions';
import importListOptions from './Settings/importListOptions';
import importLists from './Settings/importLists';
import indexerFlags from './Settings/indexerFlags';
@ -36,13 +36,13 @@ export * from './Settings/delayProfiles';
export * from './Settings/downloadClients';
export * from './Settings/downloadClientOptions';
export * from './Settings/general';
export * from './Settings/importListOptions';
export * from './Settings/importLists';
export * from './Settings/importListExclusions';
export * from './Settings/indexerFlags';
export * from './Settings/indexerOptions';
export * from './Settings/indexers';
export * from './Settings/languages';
export * from './Settings/importExclusions';
export * from './Settings/importListOptions';
export * from './Settings/importLists';
export * from './Settings/mediaManagement';
export * from './Settings/metadata';
export * from './Settings/metadataOptions';
@ -51,8 +51,8 @@ export * from './Settings/namingExamples';
export * from './Settings/notifications';
export * from './Settings/qualityDefinitions';
export * from './Settings/qualityProfiles';
export * from './Settings/remotePathMappings';
export * from './Settings/releaseProfiles';
export * from './Settings/remotePathMappings';
export * from './Settings/ui';
//
@ -73,13 +73,13 @@ export const defaultState = {
downloadClients: downloadClients.defaultState,
downloadClientOptions: downloadClientOptions.defaultState,
general: general.defaultState,
importLists: importLists.defaultState,
importListExclusions: importListExclusions.defaultState,
importListOptions: importListOptions.defaultState,
indexerFlags: indexerFlags.defaultState,
indexerOptions: indexerOptions.defaultState,
indexers: indexers.defaultState,
languages: languages.defaultState,
importExclusions: importExclusions.defaultState,
importListOptions: importListOptions.defaultState,
importLists: importLists.defaultState,
mediaManagement: mediaManagement.defaultState,
metadata: metadata.defaultState,
metadataOptions: metadataOptions.defaultState,
@ -88,8 +88,8 @@ export const defaultState = {
notifications: notifications.defaultState,
qualityDefinitions: qualityDefinitions.defaultState,
qualityProfiles: qualityProfiles.defaultState,
remotePathMappings: remotePathMappings.defaultState,
releaseProfiles: releaseProfiles.defaultState,
remotePathMappings: remotePathMappings.defaultState,
ui: ui.defaultState
};
@ -119,13 +119,13 @@ export const actionHandlers = handleThunks({
...downloadClients.actionHandlers,
...downloadClientOptions.actionHandlers,
...general.actionHandlers,
...importLists.actionHandlers,
...importListExclusions.actionHandlers,
...importListOptions.actionHandlers,
...indexerFlags.actionHandlers,
...indexerOptions.actionHandlers,
...indexers.actionHandlers,
...languages.actionHandlers,
...importExclusions.actionHandlers,
...importListOptions.actionHandlers,
...importLists.actionHandlers,
...mediaManagement.actionHandlers,
...metadata.actionHandlers,
...metadataOptions.actionHandlers,
@ -134,8 +134,8 @@ export const actionHandlers = handleThunks({
...notifications.actionHandlers,
...qualityDefinitions.actionHandlers,
...qualityProfiles.actionHandlers,
...remotePathMappings.actionHandlers,
...releaseProfiles.actionHandlers,
...remotePathMappings.actionHandlers,
...ui.actionHandlers
});
@ -156,13 +156,13 @@ export const reducers = createHandleActions({
...downloadClients.reducers,
...downloadClientOptions.reducers,
...general.reducers,
...importLists.reducers,
...importListExclusions.reducers,
...importListOptions.reducers,
...indexerFlags.reducers,
...indexerOptions.reducers,
...indexers.reducers,
...languages.reducers,
...importExclusions.reducers,
...importListOptions.reducers,
...importLists.reducers,
...mediaManagement.reducers,
...metadata.reducers,
...metadataOptions.reducers,
@ -171,8 +171,8 @@ export const reducers = createHandleActions({
...notifications.reducers,
...qualityDefinitions.reducers,
...qualityProfiles.reducers,
...remotePathMappings.reducers,
...releaseProfiles.reducers,
...remotePathMappings.reducers,
...ui.reducers
}, defaultState, section);

@ -4,9 +4,9 @@ import { createSelector } from 'reselect';
function createExclusionMovieSelector() {
return createSelector(
(state, { tmdbId }) => tmdbId,
(state) => state.settings.importExclusions,
(tmdbId, importExclusions) => {
return _.some(importExclusions.items, { tmdbId });
(state) => state.settings.importListExclusions,
(tmdbId, importListExclusions) => {
return _.some(importListExclusions.items, { tmdbId });
}
);
}

Loading…
Cancel
Save