lib/main.js
function(onProgress) {
        onProgress = onProgress || function() {};
        library.autosave(false);
        let modules_urls = [
            'https://api.unfoldingword.org/ta/txt/1/en/audio_2.json',
            'https://api.unfoldingword.org/ta/txt/1/en/checking_1.json',
            'https://api.unfoldingword.org/ta/txt/1/en/checking_2.json',
            'https://api.unfoldingword.org/ta/txt/1/en/gateway_3.json',
            'https://api.unfoldingword.org/ta/txt/1/en/intro_1.json',
            'https://api.unfoldingword.org/ta/txt/1/en/process_1.json',
            'https://api.unfoldingword.org/ta/txt/1/en/translate_1.json',
            'https://api.unfoldingword.org/ta/txt/1/en/translate_2.json'
        ];
        return promiseUtils.chain(downloadTA, function(err, data) {
            if(err instanceof Error) return Promise.reject(err);
            console.log(err);
            return false;
        }, {compact: true, onProgress: onProgress.bind(null, 'ta')})(modules_urls)
            .then(function() {
                library.commit();
                library.autosave(true);
                return Promise.resolve();
            })
            .catch(function(err) {
                library.autosave(true);
                return Promise.reject(err);
            });
    }
function(onProgress) {
        onProgress = onProgress || function() {};
        library.autosave(false);
        let modules_urls = [
            'https://api.unfoldingword.org/ta/txt/1/en/audio_2.json',
            'https://api.unfoldingword.org/ta/txt/1/en/checking_1.json',
            'https://api.unfoldingword.org/ta/txt/1/en/checking_2.json',
            'https://api.unfoldingword.org/ta/txt/1/en/gateway_3.json',
            'https://api.unfoldingword.org/ta/txt/1/en/intro_1.json',
            'https://api.unfoldingword.org/ta/txt/1/en/process_1.json',
            'https://api.unfoldingword.org/ta/txt/1/en/translate_1.json',
            'https://api.unfoldingword.org/ta/txt/1/en/translate_2.json'
        ];
        return promiseUtils.chain(downloadTA, function(err, data) {
            if(err instanceof Error) return Promise.reject(err);
            console.log(err);
            return false;
        }, {compact: true, onProgress: onProgress.bind(null, 'ta')})(modules_urls)
            .then(function() {
                library.commit();
                library.autosave(true);
                return Promise.resolve();
            })
            .catch(function(err) {
                library.autosave(true);
                return Promise.reject(err);
            });
    }
function ( onProgress ) { onProgress = onProgress || function ( ) { } ; library . autosave ( false ) ; let modules_urls = [ 'https://api.unfoldingword.org/ta/txt/1/en/audio_2.json' , 'https://api.unfoldingword.org/ta/txt/1/en/checking_1.json' , 'https://api.unfoldingword.org/ta/txt/1/en/checking_2.json' , 'https://api.unfoldingword.org/ta/txt/1/en/gateway_3.json' , 'https://api.unfoldingword.org/ta/txt/1/en/intro_1.json' , 'https://api.unfoldingword.org/ta/txt/1/en/process_1.json' , 'https://api.unfoldingword.org/ta/txt/1/en/translate_1.json' , 'https://api.unfoldingword.org/ta/txt/1/en/translate_2.json' ] ; return promiseUtils . chain ( downloadTA , function ( err , data ) { if ( err instanceof Error ) return Promise . reject ( err ) ; console . log ( err ) ; return false ; } , { compact : true , onProgress : onProgress . bind ( null , 'ta' ) } ) ( modules_urls ) . then ( function ( ) { library . commit ( ) ; library . autosave ( true ) ; return Promise . resolve ( ) ; } ) . catch ( function ( err ) { library . autosave ( true ) ; return Promise . reject ( err ) ; } ) ; }
Downloads the tA projects
@param onProgress
@returns {Promise.<>}
Downloads the tA projects