Fix download conversion setting input labels
This commit is contained in:
@@ -209,6 +209,7 @@
|
|||||||
"compression_level": "Compression level",
|
"compression_level": "Compression level",
|
||||||
"description": "In case no MIME-Type is defined, the \"default\" one will be used for the conversion.\nSet \"none\" as the target type to disable conversion for a MIME-Type",
|
"description": "In case no MIME-Type is defined, the \"default\" one will be used for the conversion.\nSet \"none\" as the target type to disable conversion for a MIME-Type",
|
||||||
"mime_type": "MIME-Type",
|
"mime_type": "MIME-Type",
|
||||||
|
"target": "MIME-Type target",
|
||||||
"title": "Download conversion"
|
"title": "Download conversion"
|
||||||
},
|
},
|
||||||
"delete_chapters": {
|
"delete_chapters": {
|
||||||
|
|||||||
@@ -137,7 +137,6 @@ const MimeTypeTextField = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Conversion = ({
|
const Conversion = ({
|
||||||
index,
|
|
||||||
shouldAutoFocusMimeTypeTextField,
|
shouldAutoFocusMimeTypeTextField,
|
||||||
conversion: { mimeType, target, compressionLevel },
|
conversion: { mimeType, target, compressionLevel },
|
||||||
setFocusMimeTypeTextField,
|
setFocusMimeTypeTextField,
|
||||||
@@ -145,7 +144,6 @@ const Conversion = ({
|
|||||||
isDuplicate,
|
isDuplicate,
|
||||||
}: {
|
}: {
|
||||||
shouldAutoFocusMimeTypeTextField: boolean;
|
shouldAutoFocusMimeTypeTextField: boolean;
|
||||||
index: number;
|
|
||||||
conversion: SettingsDownloadConversion;
|
conversion: SettingsDownloadConversion;
|
||||||
setFocusMimeTypeTextField: (focus: boolean) => void;
|
setFocusMimeTypeTextField: (focus: boolean) => void;
|
||||||
onChange: (newConversion: SettingsDownloadConversion | null) => void;
|
onChange: (newConversion: SettingsDownloadConversion | null) => void;
|
||||||
@@ -159,8 +157,6 @@ const Conversion = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
// eslint-disable-next-line react/no-array-index-key
|
|
||||||
key={`${mimeType}-${index}`}
|
|
||||||
sx={{
|
sx={{
|
||||||
gap: 1,
|
gap: 1,
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
@@ -181,7 +177,7 @@ const Conversion = ({
|
|||||||
shouldAutoFocus={shouldAutoFocusMimeTypeTextField}
|
shouldAutoFocus={shouldAutoFocusMimeTypeTextField}
|
||||||
isDefault={isDefault}
|
isDefault={isDefault}
|
||||||
isDuplicate={isDuplicate}
|
isDuplicate={isDuplicate}
|
||||||
label={t(isDefault ? 'global.label.default' : 'download.settings.conversion.mime_type')}
|
label={t('download.settings.conversion.mime_type')}
|
||||||
value={mimeType}
|
value={mimeType}
|
||||||
onUpdate={(value) => {
|
onUpdate={(value) => {
|
||||||
setFocusMimeTypeTextField(true);
|
setFocusMimeTypeTextField(true);
|
||||||
@@ -198,7 +194,7 @@ const Conversion = ({
|
|||||||
shouldAutoFocus={false}
|
shouldAutoFocus={false}
|
||||||
isDefault={false}
|
isDefault={false}
|
||||||
isDuplicate={false}
|
isDuplicate={false}
|
||||||
label={t('download.settings.conversion.compression_level')}
|
label={t('download.settings.conversion.target')}
|
||||||
value={target}
|
value={target}
|
||||||
onUpdate={(value) =>
|
onUpdate={(value) =>
|
||||||
onChange({
|
onChange({
|
||||||
@@ -209,7 +205,7 @@ const Conversion = ({
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<TextField
|
<TextField
|
||||||
label="Compression"
|
label={t('download.settings.conversion.compression_level')}
|
||||||
value={compressionLevel ?? ''}
|
value={compressionLevel ?? ''}
|
||||||
type="number"
|
type="number"
|
||||||
error={!isCompressionLevelValid}
|
error={!isCompressionLevelValid}
|
||||||
@@ -299,7 +295,6 @@ export const DownloadConversionSetting = ({
|
|||||||
key={`${mimeType}-${index}`}
|
key={`${mimeType}-${index}`}
|
||||||
conversion={conversion}
|
conversion={conversion}
|
||||||
isDuplicate={isDuplicate}
|
isDuplicate={isDuplicate}
|
||||||
index={index}
|
|
||||||
setFocusMimeTypeTextField={(focus) =>
|
setFocusMimeTypeTextField={(focus) =>
|
||||||
setFocusedMimeTypeTextFieldIndex(focus ? index : DEFAULT_FOCUS_INDEX)
|
setFocusedMimeTypeTextFieldIndex(focus ? index : DEFAULT_FOCUS_INDEX)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user