mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Changes to Profiles, Languages, Manual Import
This commit is contained in:
@@ -61,14 +61,38 @@ function createQualitiesSelector() {
|
||||
);
|
||||
}
|
||||
|
||||
function createLanguagesSelector() {
|
||||
return createSelector(
|
||||
(state) => state.settings.languages,
|
||||
(languages) => {
|
||||
const items = languages.items;
|
||||
|
||||
if (!items) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const newItems = items.map((item) => {
|
||||
return {
|
||||
key: item.id,
|
||||
value: item.name
|
||||
};
|
||||
});
|
||||
|
||||
return newItems;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
createProviderSettingsSelector('qualityProfiles'),
|
||||
createQualitiesSelector(),
|
||||
createLanguagesSelector(),
|
||||
createProfileInUseSelector('qualityProfileId'),
|
||||
(qualityProfile, qualities, isInUse) => {
|
||||
(qualityProfile, qualities, languages, isInUse) => {
|
||||
return {
|
||||
qualities,
|
||||
languages,
|
||||
...qualityProfile,
|
||||
isInUse
|
||||
};
|
||||
@@ -159,6 +183,15 @@ class EditQualityProfileModalContentConnector extends Component {
|
||||
this.props.setQualityProfileValue({ name, value: cutoffId });
|
||||
}
|
||||
|
||||
onLanguageChange = ({ name, value }) => {
|
||||
|
||||
const id = parseInt(value);
|
||||
|
||||
const language = _.find(this.props.languages, (item) => item.key === id);
|
||||
|
||||
this.props.setQualityProfileValue({ name, value: { id: language.key, Name: language.value } });
|
||||
}
|
||||
|
||||
onSavePress = () => {
|
||||
this.props.saveQualityProfile({ id: this.props.id });
|
||||
}
|
||||
@@ -413,6 +446,7 @@ class EditQualityProfileModalContentConnector extends Component {
|
||||
onSavePress={this.onSavePress}
|
||||
onInputChange={this.onInputChange}
|
||||
onCutoffChange={this.onCutoffChange}
|
||||
onLanguageChange={this.onLanguageChange}
|
||||
onCreateGroupPress={this.onCreateGroupPress}
|
||||
onDeleteGroupPress={this.onDeleteGroupPress}
|
||||
onQualityProfileItemAllowedChange={this.onQualityProfileItemAllowedChange}
|
||||
@@ -433,6 +467,7 @@ EditQualityProfileModalContentConnector.propTypes = {
|
||||
isSaving: PropTypes.bool.isRequired,
|
||||
saveError: PropTypes.object,
|
||||
item: PropTypes.object.isRequired,
|
||||
languages: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
setQualityProfileValue: PropTypes.func.isRequired,
|
||||
fetchQualityProfileSchema: PropTypes.func.isRequired,
|
||||
saveQualityProfile: PropTypes.func.isRequired,
|
||||
|
Reference in New Issue
Block a user