mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-30 03:38:26 -07:00
parent
dd11f74073
commit
5b7339cd73
92 changed files with 2611 additions and 145 deletions
|
@ -241,6 +241,12 @@ export const SET_LANGUAGE_PROFILE_VALUE = 'SET_LANGUAGE_PROFILE_VALUE';
|
|||
export const SAVE_LANGUAGE_PROFILE = 'SAVE_LANGUAGE_PROFILE';
|
||||
export const DELETE_LANGUAGE_PROFILE = 'DELETE_LANGUAGE_PROFILE';
|
||||
|
||||
export const FETCH_METADATA_PROFILES = 'FETCH_METADATA_PROFILES';
|
||||
export const FETCH_METADATA_PROFILE_SCHEMA = 'FETCH_METADATA_PROFILE_SCHEMA';
|
||||
export const SET_METADATA_PROFILE_VALUE = 'SET_METADATA_PROFILE_VALUE';
|
||||
export const SAVE_METADATA_PROFILE = 'SAVE_METADATA_PROFILE';
|
||||
export const DELETE_METADATA_PROFILE = 'DELETE_METADATA_PROFILE';
|
||||
|
||||
export const FETCH_DELAY_PROFILES = 'FETCH_DELAY_PROFILES';
|
||||
export const SET_DELAY_PROFILE_VALUE = 'SET_DELAY_PROFILE_VALUE';
|
||||
export const SAVE_DELAY_PROFILE = 'SAVE_DELAY_PROFILE';
|
||||
|
|
|
@ -111,6 +111,19 @@ const settingsActionHandlers = {
|
|||
'/languageprofile',
|
||||
(state) => state.settings.languageProfiles),
|
||||
|
||||
[types.FETCH_METADATA_PROFILES]: createFetchHandler('metadataProfiles', '/metadataprofile'),
|
||||
[types.FETCH_METADATA_PROFILE_SCHEMA]: createFetchSchemaHandler('metadataProfiles', '/metadataprofile/schema'),
|
||||
|
||||
[types.SAVE_METADATA_PROFILE]: createSaveProviderHandler(
|
||||
'metadataProfiles',
|
||||
'/metadataprofile',
|
||||
(state) => state.settings.metadataProfiles),
|
||||
|
||||
[types.DELETE_METADATA_PROFILE]: createRemoveItemHandler(
|
||||
'metadataProfiles',
|
||||
'/metadataprofile',
|
||||
(state) => state.settings.metadataProfiles),
|
||||
|
||||
[types.FETCH_DELAY_PROFILES]: createFetchHandler('delayProfiles', '/delayprofile'),
|
||||
|
||||
[types.SAVE_DELAY_PROFILE]: createSaveProviderHandler(
|
||||
|
|
|
@ -57,6 +57,18 @@ export const setLanguageProfileValue = createAction(types.SET_LANGUAGE_PROFILE_V
|
|||
};
|
||||
});
|
||||
|
||||
export const fetchMetadataProfiles = settingsActionHandlers[types.FETCH_METADATA_PROFILES];
|
||||
export const fetchMetadataProfileSchema = settingsActionHandlers[types.FETCH_METADATA_PROFILE_SCHEMA];
|
||||
export const saveMetadataProfile = settingsActionHandlers[types.SAVE_METADATA_PROFILE];
|
||||
export const deleteMetadataProfile = settingsActionHandlers[types.DELETE_METADATA_PROFILE];
|
||||
|
||||
export const setMetadataProfileValue = createAction(types.SET_METADATA_PROFILE_VALUE, (payload) => {
|
||||
return {
|
||||
section: 'metadataProfiles',
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
export const fetchDelayProfiles = settingsActionHandlers[types.FETCH_DELAY_PROFILES];
|
||||
export const saveDelayProfile = settingsActionHandlers[types.SAVE_DELAY_PROFILE];
|
||||
export const deleteDelayProfile = settingsActionHandlers[types.DELETE_DELAY_PROFILE];
|
||||
|
|
|
@ -22,8 +22,7 @@ export const defaultState = {
|
|||
monitor: 'allEpisodes',
|
||||
qualityProfileId: 0,
|
||||
languageProfileId: 0,
|
||||
primaryAlbumTypes: ['Album', 'EP'],
|
||||
secondaryAlbumTypes: ['Studio'],
|
||||
metadataProfileId: 0,
|
||||
albumFolder: true,
|
||||
tags: []
|
||||
}
|
||||
|
|
|
@ -76,6 +76,12 @@ export const defaultState = {
|
|||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'metadataProfileId',
|
||||
label: 'Metadata Profile',
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'nextAiring',
|
||||
label: 'Next Airing',
|
||||
|
|
|
@ -83,6 +83,22 @@ export const defaultState = {
|
|||
pendingChanges: {}
|
||||
},
|
||||
|
||||
metadataProfiles: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
isDeleting: false,
|
||||
deleteError: null,
|
||||
isFetchingSchema: false,
|
||||
schemaPopulated: false,
|
||||
schemaError: null,
|
||||
schema: {},
|
||||
isSaving: false,
|
||||
saveError: null,
|
||||
items: [],
|
||||
pendingChanges: {}
|
||||
},
|
||||
|
||||
delayProfiles: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
|
@ -243,6 +259,7 @@ const propertyNames = [
|
|||
const providerPropertyNames = [
|
||||
'qualityProfiles',
|
||||
'languageProfiles',
|
||||
'metadataProfiles',
|
||||
'delayProfiles',
|
||||
'indexers',
|
||||
'restrictions',
|
||||
|
@ -270,6 +287,7 @@ const settingsReducers = handleActions({
|
|||
[types.SET_NAMING_SETTINGS_VALUE]: createSetSettingValueReducer('naming'),
|
||||
[types.SET_QUALITY_PROFILE_VALUE]: createSetSettingValueReducer('qualityProfiles'),
|
||||
[types.SET_LANGUAGE_PROFILE_VALUE]: createSetSettingValueReducer('languageProfiles'),
|
||||
[types.SET_METADATA_PROFILE_VALUE]: createSetSettingValueReducer('metadataProfiles'),
|
||||
[types.SET_DELAY_PROFILE_VALUE]: createSetSettingValueReducer('delayProfiles'),
|
||||
|
||||
[types.SET_QUALITY_DEFINITION_VALUE]: function(state, { payload }) {
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import _ from 'lodash';
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
function createMetadataProfileSelector() {
|
||||
return createSelector(
|
||||
(state, { metadataProfileId }) => metadataProfileId,
|
||||
(state) => state.settings.metadataProfiles.items,
|
||||
(metadataProfileId, metadataProfiles) => {
|
||||
return _.find(metadataProfiles, { id: metadataProfileId });
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export default createMetadataProfileSelector;
|
Loading…
Add table
Add a link
Reference in a new issue