Fixed: Show size on disk when deleting movies

pull/6138/head
Robin Dadswell 4 years ago committed by GitHub
parent b330a15431
commit 2b17b5310e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -54,22 +54,18 @@ class DeleteMovieModalContent extends Component {
const {
title,
path,
statistics,
hasFile,
sizeOnDisk,
onModalClose
} = this.props;
const {
movieFileCount,
sizeOnDisk
} = statistics;
const deleteFiles = this.state.deleteFiles;
const addImportExclusion = this.state.addImportExclusion;
let deleteFilesLabel = translate('DeleteFilesLabel', [movieFileCount]);
let deleteFilesLabel = hasFile ? translate('DeleteFileLabel', [1]) : translate('DeleteFilesLabel', [0]);
let deleteFilesHelpText = translate('DeleteFilesHelpText');
if (movieFileCount === 0) {
if (!hasFile) {
deleteFilesLabel = translate('DeleteMovieFolderLabel');
deleteFilesHelpText = translate('DeleteMovieFolderHelpText');
}
@ -92,6 +88,21 @@ class DeleteMovieModalContent extends Component {
{path}
</div>
<FormGroup>
<FormLabel>
{translate('AddListExclusion')}
</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="addImportExclusion"
value={addImportExclusion}
helpText={translate('AddImportExclusionHelpText')}
kind={kinds.DANGER}
onChange={this.onAddImportExclusionChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{deleteFilesLabel}</FormLabel>
@ -113,29 +124,14 @@ class DeleteMovieModalContent extends Component {
</div>
{
!!movieFileCount &&
!!hasFile &&
<div>
{movieFileCount} {translate('MovieFilesTotaling')} {formatBytes(sizeOnDisk)}
{hasFile} {translate('MovieFilesTotaling')} {formatBytes(sizeOnDisk)}
</div>
}
</div>
}
<FormGroup>
<FormLabel>
{translate('AddListExclusion')}
</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="addImportExclusion"
value={addImportExclusion}
helpText={translate('AddImportExclusionHelpText')}
kind={kinds.DANGER}
onChange={this.onAddImportExclusionChange}
/>
</FormGroup>
</ModalBody>
<ModalFooter>
@ -158,15 +154,10 @@ class DeleteMovieModalContent extends Component {
DeleteMovieModalContent.propTypes = {
title: PropTypes.string.isRequired,
path: PropTypes.string.isRequired,
statistics: PropTypes.object.isRequired,
hasFile: PropTypes.bool.isRequired,
sizeOnDisk: PropTypes.string.isRequired,
onDeletePress: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired
};
DeleteMovieModalContent.defaultProps = {
statistics: {
movieFileCount: 0
}
};
export default DeleteMovieModalContent;

@ -195,6 +195,7 @@
"DeleteEmptyFolders": "Delete empty folders",
"DeleteEmptyFoldersHelpText": "Delete empty movie folders during disk scan and when movie files are deleted",
"DeleteFile": "Delete file",
"DeleteFileLabel": "Delete {0} Movie File",
"DeleteFilesHelpText": "Delete the movie files and movie folder",
"DeleteFilesLabel": "Delete {0} Movie Files",
"DeleteHeader": "Delete - {0}",

Loading…
Cancel
Save