mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Browse Lists from Discover Movies Page
This commit is contained in:
71
frontend/src/Store/Actions/Settings/importExclusions.js
Normal file
71
frontend/src/Store/Actions/Settings/importExclusions.js
Normal file
@@ -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.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)
|
||||
}
|
||||
|
||||
};
|
64
frontend/src/Store/Actions/Settings/importListOptions.js
Normal file
64
frontend/src/Store/Actions/Settings/importListOptions.js
Normal file
@@ -0,0 +1,64 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
|
||||
import createSaveHandler from 'Store/Actions/Creators/createSaveHandler';
|
||||
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
||||
import { createThunk } from 'Store/thunks';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
const section = 'settings.importListOptions';
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_IMPORT_LIST_OPTIONS = 'settings/importListOptions/fetchImportListOptions';
|
||||
export const SAVE_IMPORT_LIST_OPTIONS = 'settings/importListOptions/saveImportListOptions';
|
||||
export const SET_IMPORT_LIST_OPTIONS_VALUE = 'settings/importListOptions/setImportListOptionsValue';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchImportListOptions = createThunk(FETCH_IMPORT_LIST_OPTIONS);
|
||||
export const saveImportListOptions = createThunk(SAVE_IMPORT_LIST_OPTIONS);
|
||||
export const setImportListOptionsValue = createAction(SET_IMPORT_LIST_OPTIONS_VALUE, (payload) => {
|
||||
return {
|
||||
section,
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
//
|
||||
// Details
|
||||
|
||||
export default {
|
||||
|
||||
//
|
||||
// State
|
||||
|
||||
defaultState: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
pendingChanges: {},
|
||||
isSaving: false,
|
||||
saveError: null,
|
||||
item: {}
|
||||
},
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
actionHandlers: {
|
||||
[FETCH_IMPORT_LIST_OPTIONS]: createFetchHandler(section, '/config/importlist'),
|
||||
[SAVE_IMPORT_LIST_OPTIONS]: createSaveHandler(section, '/config/importlist')
|
||||
},
|
||||
|
||||
//
|
||||
// Reducers
|
||||
|
||||
reducers: {
|
||||
[SET_IMPORT_LIST_OPTIONS_VALUE]: createSetSettingValueReducer(section)
|
||||
}
|
||||
|
||||
};
|
116
frontend/src/Store/Actions/Settings/importLists.js
Normal file
116
frontend/src/Store/Actions/Settings/importLists.js
Normal file
@@ -0,0 +1,116 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
|
||||
import createFetchSchemaHandler from 'Store/Actions/Creators/createFetchSchemaHandler';
|
||||
import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHandler';
|
||||
import createSaveProviderHandler, { createCancelSaveProviderHandler } from 'Store/Actions/Creators/createSaveProviderHandler';
|
||||
import createTestAllProvidersHandler from 'Store/Actions/Creators/createTestAllProvidersHandler';
|
||||
import createTestProviderHandler, { createCancelTestProviderHandler } from 'Store/Actions/Creators/createTestProviderHandler';
|
||||
import createSetProviderFieldValueReducer from 'Store/Actions/Creators/Reducers/createSetProviderFieldValueReducer';
|
||||
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
||||
import { createThunk } from 'Store/thunks';
|
||||
import selectProviderSchema from 'Utilities/State/selectProviderSchema';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
const section = 'settings.importLists';
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_IMPORT_LISTS = 'settings/importLists/fetchImportLists';
|
||||
export const FETCH_IMPORT_LIST_SCHEMA = 'settings/importLists/fetchImportListSchema';
|
||||
export const SELECT_IMPORT_LIST_SCHEMA = 'settings/importLists/selectImportListSchema';
|
||||
export const SET_IMPORT_LIST_VALUE = 'settings/importLists/setImportListValue';
|
||||
export const SET_IMPORT_LIST_FIELD_VALUE = 'settings/importLists/setImportListFieldValue';
|
||||
export const SAVE_IMPORT_LIST = 'settings/importLists/saveImportList';
|
||||
export const CANCEL_SAVE_IMPORT_LIST = 'settings/importLists/cancelSaveImportList';
|
||||
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';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchImportLists = createThunk(FETCH_IMPORT_LISTS);
|
||||
export const fetchImportListSchema = createThunk(FETCH_IMPORT_LIST_SCHEMA);
|
||||
export const selectImportListSchema = createAction(SELECT_IMPORT_LIST_SCHEMA);
|
||||
|
||||
export const saveImportList = createThunk(SAVE_IMPORT_LIST);
|
||||
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 setImportListValue = createAction(SET_IMPORT_LIST_VALUE, (payload) => {
|
||||
return {
|
||||
section,
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
export const setImportListFieldValue = createAction(SET_IMPORT_LIST_FIELD_VALUE, (payload) => {
|
||||
return {
|
||||
section,
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
//
|
||||
// Details
|
||||
|
||||
export default {
|
||||
|
||||
//
|
||||
// State
|
||||
|
||||
defaultState: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
isSchemaFetching: false,
|
||||
isSchemaPopulated: false,
|
||||
schemaError: null,
|
||||
schema: [],
|
||||
selectedSchema: {},
|
||||
isSaving: false,
|
||||
saveError: null,
|
||||
isTesting: false,
|
||||
isTestingAll: false,
|
||||
items: [],
|
||||
pendingChanges: {}
|
||||
},
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
actionHandlers: {
|
||||
[FETCH_IMPORT_LISTS]: createFetchHandler(section, '/importlist'),
|
||||
[FETCH_IMPORT_LIST_SCHEMA]: createFetchSchemaHandler(section, '/importlist/schema'),
|
||||
|
||||
[SAVE_IMPORT_LIST]: createSaveProviderHandler(section, '/importlist'),
|
||||
[CANCEL_SAVE_IMPORT_LIST]: createCancelSaveProviderHandler(section),
|
||||
[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')
|
||||
},
|
||||
|
||||
//
|
||||
// Reducers
|
||||
|
||||
reducers: {
|
||||
[SET_IMPORT_LIST_VALUE]: createSetSettingValueReducer(section),
|
||||
[SET_IMPORT_LIST_FIELD_VALUE]: createSetProviderFieldValueReducer(section),
|
||||
|
||||
[SELECT_IMPORT_LIST_SCHEMA]: (state, { payload }) => {
|
||||
return selectProviderSchema(state, section, payload, (selectedSchema) => {
|
||||
|
||||
return selectedSchema;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
@@ -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.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)
|
||||
}
|
||||
|
||||
};
|
@@ -1,64 +0,0 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
|
||||
import createSaveHandler from 'Store/Actions/Creators/createSaveHandler';
|
||||
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
||||
import { createThunk } from 'Store/thunks';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
const section = 'settings.netImportOptions';
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_NET_IMPORT_OPTIONS = 'settings/netImportOptions/fetchNetImportOptions';
|
||||
export const SAVE_NET_IMPORT_OPTIONS = 'settings/netImportOptions/saveNetImportOptions';
|
||||
export const SET_NET_IMPORT_OPTIONS_VALUE = 'settings/netImportOptions/setNetImportOptionsValue';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchNetImportOptions = createThunk(FETCH_NET_IMPORT_OPTIONS);
|
||||
export const saveNetImportOptions = createThunk(SAVE_NET_IMPORT_OPTIONS);
|
||||
export const setNetImportOptionsValue = createAction(SET_NET_IMPORT_OPTIONS_VALUE, (payload) => {
|
||||
return {
|
||||
section,
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
//
|
||||
// Details
|
||||
|
||||
export default {
|
||||
|
||||
//
|
||||
// State
|
||||
|
||||
defaultState: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
pendingChanges: {},
|
||||
isSaving: false,
|
||||
saveError: null,
|
||||
item: {}
|
||||
},
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
actionHandlers: {
|
||||
[FETCH_NET_IMPORT_OPTIONS]: createFetchHandler(section, '/config/netimport'),
|
||||
[SAVE_NET_IMPORT_OPTIONS]: createSaveHandler(section, '/config/netimport')
|
||||
},
|
||||
|
||||
//
|
||||
// Reducers
|
||||
|
||||
reducers: {
|
||||
[SET_NET_IMPORT_OPTIONS_VALUE]: createSetSettingValueReducer(section)
|
||||
}
|
||||
|
||||
};
|
@@ -1,116 +0,0 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
|
||||
import createFetchSchemaHandler from 'Store/Actions/Creators/createFetchSchemaHandler';
|
||||
import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHandler';
|
||||
import createSaveProviderHandler, { createCancelSaveProviderHandler } from 'Store/Actions/Creators/createSaveProviderHandler';
|
||||
import createTestAllProvidersHandler from 'Store/Actions/Creators/createTestAllProvidersHandler';
|
||||
import createTestProviderHandler, { createCancelTestProviderHandler } from 'Store/Actions/Creators/createTestProviderHandler';
|
||||
import createSetProviderFieldValueReducer from 'Store/Actions/Creators/Reducers/createSetProviderFieldValueReducer';
|
||||
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
||||
import { createThunk } from 'Store/thunks';
|
||||
import selectProviderSchema from 'Utilities/State/selectProviderSchema';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
const section = 'settings.netImports';
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_NET_IMPORTS = 'settings/netImports/fetchNetImports';
|
||||
export const FETCH_NET_IMPORT_SCHEMA = 'settings/netImports/fetchNetImportSchema';
|
||||
export const SELECT_NET_IMPORT_SCHEMA = 'settings/netImports/selectNetImportSchema';
|
||||
export const SET_NET_IMPORT_VALUE = 'settings/netImports/setNetImportValue';
|
||||
export const SET_NET_IMPORT_FIELD_VALUE = 'settings/netImports/setNetImportFieldValue';
|
||||
export const SAVE_NET_IMPORT = 'settings/netImports/saveNetImport';
|
||||
export const CANCEL_SAVE_NET_IMPORT = 'settings/netImports/cancelSaveNetImport';
|
||||
export const DELETE_NET_IMPORT = 'settings/netImports/deleteNetImport';
|
||||
export const TEST_NET_IMPORT = 'settings/netImports/testNetImport';
|
||||
export const CANCEL_TEST_NET_IMPORT = 'settings/netImports/cancelTestNetImport';
|
||||
export const TEST_ALL_NET_IMPORT = 'settings/netImports/testAllNetImport';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchNetImports = createThunk(FETCH_NET_IMPORTS);
|
||||
export const fetchNetImportSchema = createThunk(FETCH_NET_IMPORT_SCHEMA);
|
||||
export const selectNetImportSchema = createAction(SELECT_NET_IMPORT_SCHEMA);
|
||||
|
||||
export const saveNetImport = createThunk(SAVE_NET_IMPORT);
|
||||
export const cancelSaveNetImport = createThunk(CANCEL_SAVE_NET_IMPORT);
|
||||
export const deleteNetImport = createThunk(DELETE_NET_IMPORT);
|
||||
export const testNetImport = createThunk(TEST_NET_IMPORT);
|
||||
export const cancelTestNetImport = createThunk(CANCEL_TEST_NET_IMPORT);
|
||||
export const testAllNetImport = createThunk(TEST_ALL_NET_IMPORT);
|
||||
|
||||
export const setNetImportValue = createAction(SET_NET_IMPORT_VALUE, (payload) => {
|
||||
return {
|
||||
section,
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
export const setNetImportFieldValue = createAction(SET_NET_IMPORT_FIELD_VALUE, (payload) => {
|
||||
return {
|
||||
section,
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
//
|
||||
// Details
|
||||
|
||||
export default {
|
||||
|
||||
//
|
||||
// State
|
||||
|
||||
defaultState: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
isSchemaFetching: false,
|
||||
isSchemaPopulated: false,
|
||||
schemaError: null,
|
||||
schema: [],
|
||||
selectedSchema: {},
|
||||
isSaving: false,
|
||||
saveError: null,
|
||||
isTesting: false,
|
||||
isTestingAll: false,
|
||||
items: [],
|
||||
pendingChanges: {}
|
||||
},
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
actionHandlers: {
|
||||
[FETCH_NET_IMPORTS]: createFetchHandler(section, '/netimport'),
|
||||
[FETCH_NET_IMPORT_SCHEMA]: createFetchSchemaHandler(section, '/netimport/schema'),
|
||||
|
||||
[SAVE_NET_IMPORT]: createSaveProviderHandler(section, '/netimport'),
|
||||
[CANCEL_SAVE_NET_IMPORT]: createCancelSaveProviderHandler(section),
|
||||
[DELETE_NET_IMPORT]: createRemoveItemHandler(section, '/netimport'),
|
||||
[TEST_NET_IMPORT]: createTestProviderHandler(section, '/netimport'),
|
||||
[CANCEL_TEST_NET_IMPORT]: createCancelTestProviderHandler(section),
|
||||
[TEST_ALL_NET_IMPORT]: createTestAllProvidersHandler(section, '/netimport')
|
||||
},
|
||||
|
||||
//
|
||||
// Reducers
|
||||
|
||||
reducers: {
|
||||
[SET_NET_IMPORT_VALUE]: createSetSettingValueReducer(section),
|
||||
[SET_NET_IMPORT_FIELD_VALUE]: createSetProviderFieldValueReducer(section),
|
||||
|
||||
[SELECT_NET_IMPORT_SCHEMA]: (state, { payload }) => {
|
||||
return selectProviderSchema(state, section, payload, (selectedSchema) => {
|
||||
|
||||
return selectedSchema;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
};
|
@@ -40,6 +40,10 @@ export const defaultState = {
|
||||
secondarySortDirection: sortDirections.ASCENDING,
|
||||
view: 'overview',
|
||||
|
||||
options: {
|
||||
includeRecommendations: true
|
||||
},
|
||||
|
||||
defaults: {
|
||||
rootFolderPath: '',
|
||||
monitor: 'true',
|
||||
@@ -57,7 +61,11 @@ export const defaultState = {
|
||||
overviewOptions: {
|
||||
detailedProgressBar: false,
|
||||
size: 'medium',
|
||||
showStudio: true
|
||||
showStudio: true,
|
||||
showRatings: true,
|
||||
showYear: true,
|
||||
showCertification: true,
|
||||
showGenres: true
|
||||
},
|
||||
|
||||
tableOptions: {
|
||||
@@ -72,6 +80,13 @@ export const defaultState = {
|
||||
isVisible: true,
|
||||
isModifiable: false
|
||||
},
|
||||
{
|
||||
name: 'isRecommendation',
|
||||
columnLabel: 'Recommedation',
|
||||
isSortable: true,
|
||||
isVisible: true,
|
||||
isModifiable: false
|
||||
},
|
||||
{
|
||||
name: 'sortTitle',
|
||||
label: translate('MovieTitle'),
|
||||
@@ -79,6 +94,12 @@ export const defaultState = {
|
||||
isVisible: true,
|
||||
isModifiable: false
|
||||
},
|
||||
{
|
||||
name: 'collection',
|
||||
label: translate('Collection'),
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'studio',
|
||||
label: translate('Studio'),
|
||||
@@ -97,6 +118,18 @@ export const defaultState = {
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'digitalRelease',
|
||||
label: translate('DigitalRelease'),
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'runtime',
|
||||
label: translate('Runtime'),
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'genres',
|
||||
label: translate('Genres'),
|
||||
@@ -115,6 +148,12 @@ export const defaultState = {
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'lists',
|
||||
label: 'Lists',
|
||||
isSortable: false,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'actions',
|
||||
columnLabel: translate('Actions'),
|
||||
@@ -146,6 +185,12 @@ export const defaultState = {
|
||||
return result;
|
||||
},
|
||||
|
||||
collection: function(item) {
|
||||
const { collection ={} } = item;
|
||||
|
||||
return collection.name;
|
||||
},
|
||||
|
||||
studio: function(item) {
|
||||
const studio = item.studio;
|
||||
|
||||
@@ -211,6 +256,25 @@ export const defaultState = {
|
||||
return tagList.sort(sortByName);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'collection',
|
||||
label: translate('Collection'),
|
||||
type: filterBuilderTypes.ARRAY,
|
||||
optionsSelector: function(items) {
|
||||
const collectionList = items.reduce((acc, movie) => {
|
||||
if (movie.collection) {
|
||||
acc.push({
|
||||
id: movie.collection.name,
|
||||
name: movie.collection.name
|
||||
});
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
return collectionList.sort(sortByName);
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'inCinemas',
|
||||
label: 'In Cinemas',
|
||||
@@ -223,6 +287,17 @@ export const defaultState = {
|
||||
type: filterBuilderTypes.DATE,
|
||||
valueType: filterBuilderValueTypes.DATE
|
||||
},
|
||||
{
|
||||
name: 'digitalRelease',
|
||||
label: 'Digital Release',
|
||||
type: filterBuilderTypes.DATE,
|
||||
valueType: filterBuilderValueTypes.DATE
|
||||
},
|
||||
{
|
||||
name: 'runtime',
|
||||
label: translate('Runtime'),
|
||||
type: filterBuilderTypes.NUMBER
|
||||
},
|
||||
{
|
||||
name: 'genres',
|
||||
label: 'Genres',
|
||||
@@ -252,6 +327,12 @@ export const defaultState = {
|
||||
label: 'Certification',
|
||||
type: filterBuilderTypes.EXACT
|
||||
},
|
||||
{
|
||||
name: 'lists',
|
||||
label: 'Lists',
|
||||
type: filterBuilderTypes.ARRAY,
|
||||
valueType: filterBuilderValueTypes.IMPORTLIST
|
||||
},
|
||||
{
|
||||
name: 'isExcluded',
|
||||
label: 'On Excluded List',
|
||||
@@ -263,6 +344,12 @@ export const defaultState = {
|
||||
label: 'Exists in Library',
|
||||
type: filterBuilderTypes.EXACT,
|
||||
valueType: filterBuilderValueTypes.BOOL
|
||||
},
|
||||
{
|
||||
name: 'isRecommendation',
|
||||
label: 'Recommended',
|
||||
type: filterBuilderTypes.EXACT,
|
||||
valueType: filterBuilderValueTypes.BOOL
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -275,6 +362,7 @@ export const persistState = [
|
||||
'discoverMovie.customFilters',
|
||||
'discoverMovie.view',
|
||||
'discoverMovie.columns',
|
||||
'discoverMovie.options',
|
||||
'discoverMovie.posterOptions',
|
||||
'discoverMovie.overviewOptions',
|
||||
'discoverMovie.tableOptions'
|
||||
@@ -294,11 +382,12 @@ export const FETCH_DISCOVER_MOVIES = 'discoverMovie/fetchDiscoverMovies';
|
||||
export const SET_LIST_MOVIE_SORT = 'discoverMovie/setListMovieSort';
|
||||
export const SET_LIST_MOVIE_FILTER = 'discoverMovie/setListMovieFilter';
|
||||
export const SET_LIST_MOVIE_VIEW = 'discoverMovie/setListMovieView';
|
||||
export const SET_LIST_MOVIE_OPTION = 'discoverMovie/setListMovieMovieOption';
|
||||
export const SET_LIST_MOVIE_TABLE_OPTION = 'discoverMovie/setListMovieTableOption';
|
||||
export const SET_LIST_MOVIE_POSTER_OPTION = 'discoverMovie/setListMoviePosterOption';
|
||||
export const SET_LIST_MOVIE_OVERVIEW_OPTION = 'discoverMovie/setListMovieOverviewOption';
|
||||
|
||||
export const ADD_NET_IMPORT_EXCLUSIONS = 'discoverMovie/addNetImportExclusions';
|
||||
export const ADD_IMPORT_EXCLUSIONS = 'discoverMovie/addImportExclusions';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
@@ -313,11 +402,12 @@ export const fetchDiscoverMovies = createThunk(FETCH_DISCOVER_MOVIES);
|
||||
export const setListMovieSort = createAction(SET_LIST_MOVIE_SORT);
|
||||
export const setListMovieFilter = createAction(SET_LIST_MOVIE_FILTER);
|
||||
export const setListMovieView = createAction(SET_LIST_MOVIE_VIEW);
|
||||
export const setListMovieOption = createAction(SET_LIST_MOVIE_OPTION);
|
||||
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 addNetImportExclusions = createThunk(ADD_NET_IMPORT_EXCLUSIONS);
|
||||
export const addImportExclusions = createThunk(ADD_IMPORT_EXCLUSIONS);
|
||||
|
||||
export const setAddMovieValue = createAction(SET_ADD_MOVIE_VALUE, (payload) => {
|
||||
return {
|
||||
@@ -339,8 +429,10 @@ export const actionHandlers = handleThunks({
|
||||
...otherPayload
|
||||
} = payload;
|
||||
|
||||
const includeRecommendations = getState().discoverMovie.options.includeRecommendations;
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/movies/discover',
|
||||
url: `/importlist/movie?includeRecommendations=${includeRecommendations}`,
|
||||
data: otherPayload,
|
||||
traditional: true
|
||||
}).request;
|
||||
@@ -392,7 +484,8 @@ export const actionHandlers = handleThunks({
|
||||
dispatch(batchActions([
|
||||
updateItem({ section: 'movies', ...data }),
|
||||
|
||||
removeItem({ section: 'discoverMovie', ...itemToUpdate }),
|
||||
itemToUpdate.lists.length === 0 ? removeItem({ section: 'discoverMovie', ...itemToUpdate }) :
|
||||
updateItem({ section: 'discoverMovie', ...itemToUpdate, isExisting: true }),
|
||||
|
||||
set({
|
||||
section,
|
||||
@@ -476,7 +569,7 @@ export const actionHandlers = handleThunks({
|
||||
});
|
||||
},
|
||||
|
||||
[ADD_NET_IMPORT_EXCLUSIONS]: function(getState, payload, dispatch) {
|
||||
[ADD_IMPORT_EXCLUSIONS]: function(getState, payload, dispatch) {
|
||||
|
||||
const ids = payload.ids;
|
||||
const items = getState().discoverMovie.items;
|
||||
@@ -496,14 +589,14 @@ export const actionHandlers = handleThunks({
|
||||
}, []);
|
||||
|
||||
const promise = createAjaxRequest({
|
||||
url: '/exclusions',
|
||||
url: '/exclusions/bulk',
|
||||
method: 'POST',
|
||||
data: JSON.stringify(exclusions)
|
||||
}).request;
|
||||
|
||||
promise.done((data) => {
|
||||
dispatch(batchActions([
|
||||
...data.map((item) => updateItem({ section: 'settings.netImportExclusions', ...item })),
|
||||
...data.map((item) => updateItem({ section: 'settings.importExclusions', ...item })),
|
||||
|
||||
...data.map((item) => updateItem({ section, id: item.tmdbId, isExcluded: true })),
|
||||
|
||||
@@ -550,6 +643,18 @@ export const reducers = createHandleActions({
|
||||
return Object.assign({}, state, { view: payload.view });
|
||||
},
|
||||
|
||||
[SET_LIST_MOVIE_OPTION]: function(state, { payload }) {
|
||||
const discoveryMovieOptions = state.options;
|
||||
|
||||
return {
|
||||
...state,
|
||||
options: {
|
||||
...discoveryMovieOptions,
|
||||
...payload
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
[SET_LIST_MOVIE_TABLE_OPTION]: createSetTableOptionReducer(section),
|
||||
|
||||
[SET_LIST_MOVIE_POSTER_OPTION]: function(state, { payload }) {
|
||||
|
@@ -7,6 +7,9 @@ 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 importListOptions from './Settings/importListOptions';
|
||||
import importLists from './Settings/importLists';
|
||||
import indexerOptions from './Settings/indexerOptions';
|
||||
import indexers from './Settings/indexers';
|
||||
import languages from './Settings/languages';
|
||||
@@ -15,9 +18,6 @@ import metadata from './Settings/metadata';
|
||||
import metadataOptions from './Settings/metadataOptions';
|
||||
import naming from './Settings/naming';
|
||||
import namingExamples from './Settings/namingExamples';
|
||||
import netImportExclusions from './Settings/netImportExclusions';
|
||||
import netImportOptions from './Settings/netImportOptions';
|
||||
import netImports from './Settings/netImports';
|
||||
import notifications from './Settings/notifications';
|
||||
import qualityDefinitions from './Settings/qualityDefinitions';
|
||||
import qualityProfiles from './Settings/qualityProfiles';
|
||||
@@ -34,9 +34,9 @@ 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/importExclusions';
|
||||
export * from './Settings/importListOptions';
|
||||
export * from './Settings/importLists';
|
||||
export * from './Settings/mediaManagement';
|
||||
export * from './Settings/metadata';
|
||||
export * from './Settings/metadataOptions';
|
||||
@@ -69,9 +69,9 @@ export const defaultState = {
|
||||
indexerOptions: indexerOptions.defaultState,
|
||||
indexers: indexers.defaultState,
|
||||
languages: languages.defaultState,
|
||||
netImportExclusions: netImportExclusions.defaultState,
|
||||
netImportOptions: netImportOptions.defaultState,
|
||||
netImports: netImports.defaultState,
|
||||
importExclusions: importExclusions.defaultState,
|
||||
importListOptions: importListOptions.defaultState,
|
||||
importLists: importLists.defaultState,
|
||||
mediaManagement: mediaManagement.defaultState,
|
||||
metadata: metadata.defaultState,
|
||||
metadataOptions: metadataOptions.defaultState,
|
||||
@@ -112,9 +112,9 @@ export const actionHandlers = handleThunks({
|
||||
...indexerOptions.actionHandlers,
|
||||
...indexers.actionHandlers,
|
||||
...languages.actionHandlers,
|
||||
...netImportExclusions.actionHandlers,
|
||||
...netImportOptions.actionHandlers,
|
||||
...netImports.actionHandlers,
|
||||
...importExclusions.actionHandlers,
|
||||
...importListOptions.actionHandlers,
|
||||
...importLists.actionHandlers,
|
||||
...mediaManagement.actionHandlers,
|
||||
...metadata.actionHandlers,
|
||||
...metadataOptions.actionHandlers,
|
||||
@@ -146,9 +146,9 @@ export const reducers = createHandleActions({
|
||||
...indexerOptions.reducers,
|
||||
...indexers.reducers,
|
||||
...languages.reducers,
|
||||
...netImportExclusions.reducers,
|
||||
...netImportOptions.reducers,
|
||||
...netImports.reducers,
|
||||
...importExclusions.reducers,
|
||||
...importListOptions.reducers,
|
||||
...importLists.reducers,
|
||||
...mediaManagement.reducers,
|
||||
...metadata.reducers,
|
||||
...metadataOptions.reducers,
|
||||
|
Reference in New Issue
Block a user