dist/download.js
function makeHttpRequests(options, fileHashes) {
    if (options.verbose) {
        _utils.logger.info('Performing HTTP requests...');
    }
    var promises = [];
    var _iteratorNormalCompletion4 = true;
    var _didIteratorError4 = false;
    var _iteratorError4 = undefined;

    try {
        for (var _iterator4 = fileHashes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
            var fileWithHash = _step4.value;

            if (fileWithHash.subtitlesPresent) continue;
            if (options.verbose) {
                _utils.logger.info('Downloading subtitles for file [%s] with hash [%s]', fileWithHash.file, fileWithHash.hash);
            }
            var httpRequest = new _utils.HttpRequest(options, fileWithHash);
            promises.push(httpRequest.request());
        }
    } catch (err) {
        _didIteratorError4 = true;
        _iteratorError4 = err;
    } finally {
        try {
            if (!_iteratorNormalCompletion4 && _iterator4.return) {
                _iterator4.return();
            }
        } finally {
            if (_didIteratorError4) {
                throw _iteratorError4;
            }
        }
    }

    return Promise.all(promises);
}
function makeHttpRequests(options, fileHashes) {
    if (options.verbose) {
        _utils.logger.info('Performing HTTP requests...');
    }
    var promises = [];
    var _iteratorNormalCompletion4 = true;
    var _didIteratorError4 = false;
    var _iteratorError4 = undefined;

    try {
        for (var _iterator4 = fileHashes[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
            var fileWithHash = _step4.value;

            if (fileWithHash.subtitlesPresent) continue;
            if (options.verbose) {
                _utils.logger.info('Downloading subtitles for file [%s] with hash [%s]', fileWithHash.file, fileWithHash.hash);
            }
            var httpRequest = new _utils.HttpRequest(options, fileWithHash);
            promises.push(httpRequest.request());
        }
    } catch (err) {
        _didIteratorError4 = true;
        _iteratorError4 = err;
    } finally {
        try {
            if (!_iteratorNormalCompletion4 && _iterator4.return) {
                _iterator4.return();
            }
        } finally {
            if (_didIteratorError4) {
                throw _iteratorError4;
            }
        }
    }

    return Promise.all(promises);
}
function makeHttpRequests ( options , fileHashes ) { if ( options . verbose ) { _utils . logger . info ( 'Performing HTTP requests...' ) ; } var promises = [ ] ; var _iteratorNormalCompletion4 = true ; var _didIteratorError4 = false ; var _iteratorError4 = undefined ; try { for ( var _iterator4 = fileHashes [ Symbol . iterator ] ( ) , _step4 ; ! ( _iteratorNormalCompletion4 = ( _step4 = _iterator4 . next ( ) ) . done ) ; _iteratorNormalCompletion4 = true ) { var fileWithHash = _step4 . value ; if ( fileWithHash . subtitlesPresent ) continue ; if ( options . verbose ) { _utils . logger . info ( 'Downloading subtitles for file [%s] with hash [%s]' , fileWithHash . file , fileWithHash . hash ) ; } var httpRequest = new _utils . HttpRequest ( options , fileWithHash ) ; promises . push ( httpRequest . request ( ) ) ; } } catch ( err ) { _didIteratorError4 = true ; _iteratorError4 = err ; } finally { try { if ( ! _iteratorNormalCompletion4 && _iterator4 . return ) { _iterator4 . return ( ) ; } } finally { if ( _didIteratorError4 ) { throw _iteratorError4 ; } } } return Promise . all ( promises ) ; }
Perform HTTP request to Napiprojekt server
@param {NapijsOptions} options
@param fileHashes
@returns {Promise}
Perform HTTP request to Napiprojekt server