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 { const {
title, title,
path, path,
statistics, hasFile,
sizeOnDisk,
onModalClose onModalClose
} = this.props; } = this.props;
const {
movieFileCount,
sizeOnDisk
} = statistics;
const deleteFiles = this.state.deleteFiles; const deleteFiles = this.state.deleteFiles;
const addImportExclusion = this.state.addImportExclusion; const addImportExclusion = this.state.addImportExclusion;
let deleteFilesLabel = translate('DeleteFilesLabel', [movieFileCount]); let deleteFilesLabel = hasFile ? translate('DeleteFileLabel', [1]) : translate('DeleteFilesLabel', [0]);
let deleteFilesHelpText = translate('DeleteFilesHelpText'); let deleteFilesHelpText = translate('DeleteFilesHelpText');
if (movieFileCount === 0) { if (!hasFile) {
deleteFilesLabel = translate('DeleteMovieFolderLabel'); deleteFilesLabel = translate('DeleteMovieFolderLabel');
deleteFilesHelpText = translate('DeleteMovieFolderHelpText'); deleteFilesHelpText = translate('DeleteMovieFolderHelpText');
} }
@ -92,6 +88,21 @@ class DeleteMovieModalContent extends Component {
{path} {path}
</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>
<FormGroup> <FormGroup>
<FormLabel>{deleteFilesLabel}</FormLabel> <FormLabel>{deleteFilesLabel}</FormLabel>
@ -113,29 +124,14 @@ class DeleteMovieModalContent extends Component {
</div> </div>
{ {
!!movieFileCount && !!hasFile &&
<div> <div>
{movieFileCount} {translate('MovieFilesTotaling')} {formatBytes(sizeOnDisk)} {hasFile} {translate('MovieFilesTotaling')} {formatBytes(sizeOnDisk)}
</div> </div>
} }
</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> </ModalBody>
<ModalFooter> <ModalFooter>
@ -158,15 +154,10 @@ class DeleteMovieModalContent extends Component {
DeleteMovieModalContent.propTypes = { DeleteMovieModalContent.propTypes = {
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
path: PropTypes.string.isRequired, path: PropTypes.string.isRequired,
statistics: PropTypes.object.isRequired, hasFile: PropTypes.bool.isRequired,
sizeOnDisk: PropTypes.string.isRequired,
onDeletePress: PropTypes.func.isRequired, onDeletePress: PropTypes.func.isRequired,
onModalClose: PropTypes.func.isRequired onModalClose: PropTypes.func.isRequired
}; };
DeleteMovieModalContent.defaultProps = {
statistics: {
movieFileCount: 0
}
};
export default DeleteMovieModalContent; export default DeleteMovieModalContent;

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

Loading…
Cancel
Save