diff --git a/client/src/javascript/actions/TorrentActions.js b/client/src/javascript/actions/TorrentActions.js index fba0e64a..6a5caad6 100644 --- a/client/src/javascript/actions/TorrentActions.js +++ b/client/src/javascript/actions/TorrentActions.js @@ -135,7 +135,7 @@ const TorrentActions = { ), moveTorrents: (hashes, options) => { - const {destination, isBasePath, filenames, sourcePaths, moveFiles} = options; + const {destination, isBasePath, filenames, sourcePaths, moveFiles, isCheckHash} = options; return axios .post(`${baseURI}api/client/torrents/move`, { @@ -145,6 +145,7 @@ const TorrentActions = { filenames, sourcePaths, moveFiles, + isCheckHash, }) .then((json = {}) => json.data) .then( diff --git a/client/src/javascript/components/modals/move-torrents-modal/MoveTorrentsModal.js b/client/src/javascript/components/modals/move-torrents-modal/MoveTorrentsModal.js index 613670d2..505d2ef8 100644 --- a/client/src/javascript/components/modals/move-torrents-modal/MoveTorrentsModal.js +++ b/client/src/javascript/components/modals/move-torrents-modal/MoveTorrentsModal.js @@ -31,6 +31,15 @@ class MoveTorrents extends React.Component { id: 'moveFiles', type: 'checkbox', }, + { + checked: true, + content: this.props.intl.formatMessage({ + id: 'torrents.move.check_hash.label', + defaultMessage: 'Check hash', + }), + id: 'isCheckHash', + type: 'checkbox', + }, { content: this.props.intl.formatMessage({ id: 'button.cancel', @@ -74,6 +83,7 @@ class MoveTorrents extends React.Component { filenames, moveFiles: formData.moveFiles, sourcePaths, + isCheckHash: formData.isCheckHash, }).then(() => { this.setState({isSettingDownloadPath: false}); }); diff --git a/client/src/javascript/i18n/en.js b/client/src/javascript/i18n/en.js index 9c22070a..d8bbe789 100644 --- a/client/src/javascript/i18n/en.js +++ b/client/src/javascript/i18n/en.js @@ -311,6 +311,7 @@ export default { 'torrents.move.button.set.location': 'Set Location', 'torrents.move.button.state.setting': 'Setting...', 'torrents.move.data.label': 'Move data', + 'torrents.move.check_hash.label': 'Check hash', 'torrents.move.heading': 'Set Torrent Location', 'torrents.properties.date.added': 'Added', diff --git a/server/models/client.js b/server/models/client.js index 55e3eb34..9eb91d20 100644 --- a/server/models/client.js +++ b/server/models/client.js @@ -227,7 +227,7 @@ const client = { moveTorrents(user, services, data, callback) { const destinationPath = data.destination; - const {isBasePath, hashes, filenames, moveFiles, sourcePaths} = data; + const {isBasePath, hashes, filenames, moveFiles, sourcePaths, isCheckHash} = data; const mainRequest = new ClientRequest(user, services); const hashesToRestart = hashes.filter( @@ -247,12 +247,18 @@ const client = { afterCheckHash = callback; } - const checkHash = () => { - const checkHashRequest = new ClientRequest(user, services); - checkHashRequest.checkHash({hashes}); - checkHashRequest.onComplete(afterCheckHash); - checkHashRequest.send(); - }; + let checkHash; + + if (isCheckHash) { + checkHash = () => { + const checkHashRequest = new ClientRequest(user, services); + checkHashRequest.checkHash({hashes}); + checkHashRequest.onComplete(afterCheckHash); + checkHashRequest.send(); + }; + } else { + checkHash = afterCheckHash; + } const moveTorrents = () => { const moveTorrentsRequest = new ClientRequest(user, services);