mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Changed: Remove Language Profiles (#870)
* Changed: Remove Language Profiles * fixup! Changed: Remove Language Profiles * fixup! Changed: Remove Language Profiles * Remove unused method in FileNameBuilder * Fixed: Cleanup Int Converter Copy/Paste Issues and Grammar
This commit is contained in:
parent
8f791abbf6
commit
8b860bcb82
227 changed files with 345 additions and 5873 deletions
|
@ -1,97 +0,0 @@
|
|||
import { createAction } from 'redux-actions';
|
||||
import { createThunk } from 'Store/thunks';
|
||||
import getSectionState from 'Utilities/State/getSectionState';
|
||||
import updateSectionState from 'Utilities/State/updateSectionState';
|
||||
import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer';
|
||||
import createFetchHandler from 'Store/Actions/Creators/createFetchHandler';
|
||||
import createFetchSchemaHandler from 'Store/Actions/Creators/createFetchSchemaHandler';
|
||||
import createSaveProviderHandler from 'Store/Actions/Creators/createSaveProviderHandler';
|
||||
import createRemoveItemHandler from 'Store/Actions/Creators/createRemoveItemHandler';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
const section = 'settings.languageProfiles';
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_LANGUAGE_PROFILES = 'settings/languageProfiles/fetchLanguageProfiles';
|
||||
export const FETCH_LANGUAGE_PROFILE_SCHEMA = 'settings/languageProfiles/fetchLanguageProfileSchema';
|
||||
export const SAVE_LANGUAGE_PROFILE = 'settings/languageProfiles/saveLanguageProfile';
|
||||
export const DELETE_LANGUAGE_PROFILE = 'settings/languageProfiles/deleteLanguageProfile';
|
||||
export const SET_LANGUAGE_PROFILE_VALUE = 'settings/languageProfiles/setLanguageProfileValue';
|
||||
export const CLONE_LANGUAGE_PROFILE = 'settings/languageProfiles/cloneLanguageProfile';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchLanguageProfiles = createThunk(FETCH_LANGUAGE_PROFILES);
|
||||
export const fetchLanguageProfileSchema = createThunk(FETCH_LANGUAGE_PROFILE_SCHEMA);
|
||||
export const saveLanguageProfile = createThunk(SAVE_LANGUAGE_PROFILE);
|
||||
export const deleteLanguageProfile = createThunk(DELETE_LANGUAGE_PROFILE);
|
||||
|
||||
export const setLanguageProfileValue = createAction(SET_LANGUAGE_PROFILE_VALUE, (payload) => {
|
||||
return {
|
||||
section,
|
||||
...payload
|
||||
};
|
||||
});
|
||||
|
||||
export const cloneLanguageProfile = createAction(CLONE_LANGUAGE_PROFILE);
|
||||
|
||||
//
|
||||
// Details
|
||||
|
||||
export default {
|
||||
|
||||
//
|
||||
// State
|
||||
|
||||
defaultState: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
isDeleting: false,
|
||||
deleteError: null,
|
||||
isSchemaFetching: false,
|
||||
isSchemaPopulated: false,
|
||||
schemaError: null,
|
||||
schema: {},
|
||||
isSaving: false,
|
||||
saveError: null,
|
||||
items: [],
|
||||
pendingChanges: {}
|
||||
},
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
actionHandlers: {
|
||||
[FETCH_LANGUAGE_PROFILES]: createFetchHandler(section, '/languageprofile'),
|
||||
[FETCH_LANGUAGE_PROFILE_SCHEMA]: createFetchSchemaHandler(section, '/languageprofile/schema'),
|
||||
[SAVE_LANGUAGE_PROFILE]: createSaveProviderHandler(section, '/languageprofile'),
|
||||
[DELETE_LANGUAGE_PROFILE]: createRemoveItemHandler(section, '/languageprofile')
|
||||
},
|
||||
|
||||
//
|
||||
// Reducers
|
||||
|
||||
reducers: {
|
||||
[SET_LANGUAGE_PROFILE_VALUE]: createSetSettingValueReducer(section),
|
||||
|
||||
[CLONE_LANGUAGE_PROFILE]: function(state, { payload }) {
|
||||
const id = payload.id;
|
||||
const newState = getSectionState(state, section);
|
||||
const item = newState.items.find((i) => i.id === id);
|
||||
const pendingChanges = { ...item, id: 0 };
|
||||
delete pendingChanges.id;
|
||||
|
||||
pendingChanges.name = `${pendingChanges.name} - Copy`;
|
||||
newState.pendingChanges = pendingChanges;
|
||||
|
||||
return updateSectionState(state, section, newState);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
|
@ -14,8 +14,3 @@ export const SET_IS_SIDEBAR_VISIBLE = 'SET_IS_SIDEBAR_VISIBLE';
|
|||
export const FETCH_GENERAL_SETTINGS = 'settings/general/fetchGeneralSettings';
|
||||
export const SET_GENERAL_SETTINGS_VALUE = 'settings/general/setGeneralSettingsValue';
|
||||
export const SAVE_GENERAL_SETTINGS = 'settings/general/saveGeneralSettings';
|
||||
|
||||
//
|
||||
// Languages
|
||||
|
||||
export const FETCH_LANGUAGES = 'FETCH_LANGUAGES';
|
||||
|
|
|
@ -33,7 +33,6 @@ export const defaultState = {
|
|||
rootFolderPath: '',
|
||||
monitor: monitorOptions[0].key,
|
||||
qualityProfileId: 0,
|
||||
languageProfileId: 0,
|
||||
metadataProfileId: 0,
|
||||
albumFolder: true,
|
||||
tags: []
|
||||
|
|
|
@ -52,12 +52,6 @@ export const defaultState = {
|
|||
type: filterBuilderTypes.EXACT,
|
||||
valueType: filterBuilderValueTypes.QUALITY_PROFILE
|
||||
},
|
||||
{
|
||||
name: 'languageProfileId',
|
||||
label: 'Language Profile',
|
||||
type: filterBuilderTypes.EXACT,
|
||||
valueType: filterBuilderValueTypes.LANGUAGE_PROFILE
|
||||
},
|
||||
{
|
||||
name: 'metadataProfileId',
|
||||
label: 'Metadata Profile',
|
||||
|
|
|
@ -49,12 +49,6 @@ export const defaultState = {
|
|||
type: filterBuilderTypes.EXACT,
|
||||
valueType: filterBuilderValueTypes.QUALITY_PROFILE
|
||||
},
|
||||
{
|
||||
name: 'languageProfileId',
|
||||
label: 'Language Profile',
|
||||
type: filterBuilderTypes.EXACT,
|
||||
valueType: filterBuilderValueTypes.LANGUAGE_PROFILE
|
||||
},
|
||||
{
|
||||
name: 'metadataProfileId',
|
||||
label: 'Metadata Profile',
|
||||
|
|
|
@ -85,12 +85,6 @@ export const defaultState = {
|
|||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'languageProfileId',
|
||||
label: 'Language Profile',
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'metadataProfileId',
|
||||
label: 'Metadata Profile',
|
||||
|
@ -250,12 +244,6 @@ export const defaultState = {
|
|||
type: filterBuilderTypes.EXACT,
|
||||
valueType: filterBuilderValueTypes.QUALITY_PROFILE
|
||||
},
|
||||
{
|
||||
name: 'languageProfileId',
|
||||
label: 'Language Profile',
|
||||
type: filterBuilderTypes.EXACT,
|
||||
valueType: filterBuilderValueTypes.LANGUAGE_PROFILE
|
||||
},
|
||||
{
|
||||
name: 'metadataProfileId',
|
||||
label: 'Metadata Profile',
|
||||
|
|
|
@ -38,11 +38,6 @@ export const defaultState = {
|
|||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'language',
|
||||
label: 'Language',
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'quality',
|
||||
label: 'Quality',
|
||||
|
|
|
@ -50,11 +50,6 @@ export const defaultState = {
|
|||
label: 'Track Title',
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'language',
|
||||
label: 'Language',
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'quality',
|
||||
label: 'Quality',
|
||||
|
|
|
@ -80,12 +80,6 @@ export const defaultState = {
|
|||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'language',
|
||||
label: 'Language',
|
||||
isSortable: true,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'quality',
|
||||
label: 'Quality',
|
||||
|
|
|
@ -7,7 +7,6 @@ import downloadClientOptions from './Settings/downloadClientOptions';
|
|||
import general from './Settings/general';
|
||||
import indexerOptions from './Settings/indexerOptions';
|
||||
import indexers from './Settings/indexers';
|
||||
import languageProfiles from './Settings/languageProfiles';
|
||||
import importLists from './Settings/importLists';
|
||||
import importListExclusions from './Settings/importListExclusions';
|
||||
import metadataProfiles from './Settings/metadataProfiles';
|
||||
|
@ -31,7 +30,6 @@ export * from './Settings/importLists';
|
|||
export * from './Settings/importListExclusions';
|
||||
export * from './Settings/indexerOptions';
|
||||
export * from './Settings/indexers';
|
||||
export * from './Settings/languageProfiles';
|
||||
export * from './Settings/metadataProfiles';
|
||||
export * from './Settings/mediaManagement';
|
||||
export * from './Settings/metadata';
|
||||
|
@ -62,7 +60,6 @@ export const defaultState = {
|
|||
general: general.defaultState,
|
||||
indexerOptions: indexerOptions.defaultState,
|
||||
indexers: indexers.defaultState,
|
||||
languageProfiles: languageProfiles.defaultState,
|
||||
importLists: importLists.defaultState,
|
||||
importListExclusions: importListExclusions.defaultState,
|
||||
metadataProfiles: metadataProfiles.defaultState,
|
||||
|
@ -103,7 +100,6 @@ export const actionHandlers = handleThunks({
|
|||
...general.actionHandlers,
|
||||
...indexerOptions.actionHandlers,
|
||||
...indexers.actionHandlers,
|
||||
...languageProfiles.actionHandlers,
|
||||
...importLists.actionHandlers,
|
||||
...importListExclusions.actionHandlers,
|
||||
...metadataProfiles.actionHandlers,
|
||||
|
@ -135,7 +131,6 @@ export const reducers = createHandleActions({
|
|||
...general.reducers,
|
||||
...indexerOptions.reducers,
|
||||
...indexers.reducers,
|
||||
...languageProfiles.reducers,
|
||||
...importLists.reducers,
|
||||
...importListExclusions.reducers,
|
||||
...metadataProfiles.reducers,
|
||||
|
|
|
@ -55,11 +55,6 @@ export const defaultState = {
|
|||
label: 'Duration',
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'language',
|
||||
label: 'Language',
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
name: 'audioInfo',
|
||||
label: 'Audio Info',
|
||||
|
|
|
@ -139,7 +139,6 @@ export const actionHandlers = handleThunks({
|
|||
[UPDATE_TRACK_FILES]: function(getState, payload, dispatch) {
|
||||
const {
|
||||
trackFileIds,
|
||||
language,
|
||||
quality
|
||||
} = payload;
|
||||
|
||||
|
@ -149,10 +148,6 @@ export const actionHandlers = handleThunks({
|
|||
trackFileIds
|
||||
};
|
||||
|
||||
if (language) {
|
||||
data.language = language;
|
||||
}
|
||||
|
||||
if (quality) {
|
||||
data.quality = quality;
|
||||
}
|
||||
|
@ -169,10 +164,6 @@ export const actionHandlers = handleThunks({
|
|||
...trackFileIds.map((id) => {
|
||||
const props = {};
|
||||
|
||||
if (language) {
|
||||
props.language = language;
|
||||
}
|
||||
|
||||
if (quality) {
|
||||
props.quality = quality;
|
||||
}
|
||||
|
|
|
@ -125,11 +125,6 @@ export const defaultState = {
|
|||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
name: 'language',
|
||||
label: 'Language',
|
||||
isVisible: false
|
||||
},
|
||||
// {
|
||||
// name: 'status',
|
||||
// label: 'Status',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue