mirror of
https://github.com/zoriya/flood.git
synced 2026-05-31 10:22:44 +00:00
moveTorrents: Allow hash check to be skipped by user
Signed-off-by: Jesse Chan <jc@linux.com>
This commit is contained in:
+13
-7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user