mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 12:33:00 +02:00
Fixed: List Exclusions, List Processing Tweaks
This commit is contained in:
69
frontend/src/Store/Actions/Settings/netImportExclusions.js
Normal file
69
frontend/src/Store/Actions/Settings/netImportExclusions.js
Normal file
@@ -0,0 +1,69 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import { createThunk } from 'Store/thunks';
|
||||
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
||||
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
|
||||
import createSaveProviderHandler from 'Store/Actions/Creators/createSaveProviderHandler';
|
||||
import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHandler';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
const section = 'settings.netImportExclusions';
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_NET_IMPORT_EXCLUSIONS = 'settings/netImportExclusions/fetchNetImportExclusions';
|
||||
export const SAVE_NET_IMPORT_EXCLUSION = 'settings/netImportExclusions/saveNetImportExclusion';
|
||||
export const DELETE_NET_IMPORT_EXCLUSION = 'settings/netImportExclusions/deleteNetImportExclusion';
|
||||
export const SET_NET_IMPORT_EXCLUSION_VALUE = 'settings/netImportExclusions/setNetImportExclusionValue';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchNetImportExclusions = createThunk(FETCH_NET_IMPORT_EXCLUSIONS);
|
||||
export const saveNetImportExclusion = createThunk(SAVE_NET_IMPORT_EXCLUSION);
|
||||
export const deleteNetImportExclusion = createThunk(DELETE_NET_IMPORT_EXCLUSION);
|
||||
|
||||
export const setNetImportExclusionValue = createAction(SET_NET_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_NET_IMPORT_EXCLUSIONS]: createFetchHandler(section, '/exclusions'),
|
||||
[SAVE_NET_IMPORT_EXCLUSION]: createSaveProviderHandler(section, '/exclusions'),
|
||||
[DELETE_NET_IMPORT_EXCLUSION]: createRemoveItemHandler(section, '/exclusions')
|
||||
},
|
||||
|
||||
//
|
||||
// Reducers
|
||||
|
||||
reducers: {
|
||||
[SET_NET_IMPORT_EXCLUSION_VALUE]: createSetSettingValueReducer(section)
|
||||
}
|
||||
|
||||
};
|
@@ -9,6 +9,7 @@ import general from './Settings/general';
|
||||
import indexerOptions from './Settings/indexerOptions';
|
||||
import indexers from './Settings/indexers';
|
||||
import languages from './Settings/languages';
|
||||
import netImportExclusions from './Settings/netImportExclusions';
|
||||
import netImportOptions from './Settings/netImportOptions';
|
||||
import netImports from './Settings/netImports';
|
||||
import mediaManagement from './Settings/mediaManagement';
|
||||
@@ -30,6 +31,7 @@ export * from './Settings/general';
|
||||
export * from './Settings/indexerOptions';
|
||||
export * from './Settings/indexers';
|
||||
export * from './Settings/languages';
|
||||
export * from './Settings/netImportExclusions';
|
||||
export * from './Settings/netImportOptions';
|
||||
export * from './Settings/netImports';
|
||||
export * from './Settings/mediaManagement';
|
||||
@@ -62,6 +64,7 @@ export const defaultState = {
|
||||
indexerOptions: indexerOptions.defaultState,
|
||||
indexers: indexers.defaultState,
|
||||
languages: languages.defaultState,
|
||||
netImportExclusions: netImportExclusions.defaultState,
|
||||
netImportOptions: netImportOptions.defaultState,
|
||||
netImports: netImports.defaultState,
|
||||
mediaManagement: mediaManagement.defaultState,
|
||||
@@ -102,6 +105,7 @@ export const actionHandlers = handleThunks({
|
||||
...indexerOptions.actionHandlers,
|
||||
...indexers.actionHandlers,
|
||||
...languages.actionHandlers,
|
||||
...netImportExclusions.actionHandlers,
|
||||
...netImportOptions.actionHandlers,
|
||||
...netImports.actionHandlers,
|
||||
...mediaManagement.actionHandlers,
|
||||
@@ -133,6 +137,7 @@ export const reducers = createHandleActions({
|
||||
...indexerOptions.reducers,
|
||||
...indexers.reducers,
|
||||
...languages.reducers,
|
||||
...netImportExclusions.reducers,
|
||||
...netImportOptions.reducers,
|
||||
...netImports.reducers,
|
||||
...mediaManagement.reducers,
|
||||
|
14
frontend/src/Store/Selectors/createExclusionMovieSelector.js
Normal file
14
frontend/src/Store/Selectors/createExclusionMovieSelector.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import _ from 'lodash';
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
function createExclusionMovieSelector() {
|
||||
return createSelector(
|
||||
(state, { tmdbId }) => tmdbId,
|
||||
(state) => state.settings.netImportExclusions,
|
||||
(tmdbId, netImportExclusions) => {
|
||||
return _.some(netImportExclusions.items, { tmdbId });
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export default createExclusionMovieSelector;
|
Reference in New Issue
Block a user