Built motion from commit cafec4f3.|2.6.31
[motion2.git] / server / config / schedule / transcribe.js
index 8306447..704c59f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b37=['util','bluebird','../../config/logger','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','length','transcripts','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','push','all','start','lodash','aws-sdk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b37,0xd9));var _0x77b3=function(_0x49e3a4,_0x263356){_0x49e3a4=_0x49e3a4-0x0;var _0x1e36a5=_0x7b37[_0x49e3a4];return _0x1e36a5;};var _=require(_0x77b3('0x0'));var AWS=require(_0x77b3('0x1'));var rp=require('request-promise');var util=require(_0x77b3('0x2'));var BPromise=require(_0x77b3('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x77b3('0x4'))('transcribe');function getTranscriptionJob(_0x2719f2,_0x2c94ea,_0x2d64f7,_0x579ea7){return new Promise(function(_0x3acdea,_0x32345c){var _0x515f06=new AWS['TranscribeService']({'accessKeyId':_0x2c94ea,'secretAccessKey':_0x2719f2,'region':_0x2d64f7});_0x515f06[_0x77b3('0x5')]({'TranscriptionJobName':_0x579ea7},function(_0x5b3fb4,_0x35becb){if(_0x5b3fb4){return _0x32345c(_0x5b3fb4);}else{return _0x3acdea(_0x35becb);}});});}function sentiment(_0x37fafb,_0x4b3a98,_0x46dc45,_0x31b2ac,_0x24f2a1){return new Promise(function(_0x27bfa6,_0x203a71){var _0x29c263=new AWS[(_0x77b3('0x6'))]({'accessKeyId':_0x4b3a98,'secretAccessKey':_0x37fafb,'region':_0x46dc45});_0x29c263[_0x77b3('0x7')]({'Text':_0x31b2ac,'LanguageCode':_0x24f2a1[_0x77b3('0x8')](0x0,0x2)},function(_0x3e100c,_0x58f30a){if(_0x3e100c){return _0x203a71(_0x3e100c);}else{return _0x27bfa6(_0x58f30a);}});});}function checkTranscribeJob(_0x13bc8e,_0x48adca,_0x804b7){var _0x16692f;return new BPromise(function(_0x3ee308,_0x363de1){logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0xb'),_0x13bc8e['id'],_0x13bc8e[_0x77b3('0xc')]));return getTranscriptionJob(_0x804b7[_0x77b3('0xd')],_0x804b7[_0x77b3('0xe')],_0x48adca['transcribeRegion'],_0x13bc8e[_0x77b3('0xc')])[_0x77b3('0xf')](function(_0x1c995c){logger[_0x77b3('0x9')](util['format'](_0x77b3('0x10'),_0x13bc8e['id'],_0x13bc8e['transcribeName'],_0x1c995c['TranscriptionJob'][_0x77b3('0x11')]));if(!_0x13bc8e[_0x77b3('0x12')]){switch(_0x1c995c[_0x77b3('0x13')][_0x77b3('0x11')]){case'COMPLETED':var _0x26f445={'transcribeStatus':_0x1c995c['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x1c995c[_0x77b3('0x13')][_0x77b3('0x14')][_0x77b3('0x15')]};logger['info'](util[_0x77b3('0xa')](_0x77b3('0x16'),_0x13bc8e['id']));return rp({'uri':_0x1c995c[_0x77b3('0x13')][_0x77b3('0x14')][_0x77b3('0x15')],'json':!![]})[_0x77b3('0xf')](function(_0x174058){logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x17'),_0x13bc8e['id']));if(_0x174058&&_0x174058['results']&&_0x174058[_0x77b3('0x18')]['transcripts']&&_0x174058[_0x77b3('0x18')]['transcripts'][_0x77b3('0x19')]){_0x26f445[_0x77b3('0x12')]='';for(var _0x37de70=0x0;_0x37de70<_0x174058[_0x77b3('0x18')][_0x77b3('0x1a')]['length'];_0x37de70++){_0x26f445['fileText']+=_0x174058[_0x77b3('0x18')][_0x77b3('0x1a')][_0x37de70][_0x77b3('0x1b')]+'';}}return _0x13bc8e['update'](_0x26f445);})[_0x77b3('0xf')](function(){logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x1c'),_0x13bc8e['id']));if(!_0x13bc8e[_0x77b3('0x1d')]){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x1f'));}if(!_0x48adca[_0x77b3('0x20')]||!_0x48adca['sentimentAccountId']||!_0x48adca['sentimentRegion']||!_0x48adca[_0x77b3('0x21')]||!_0x48adca[_0x77b3('0x22')]){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x24'));}if(!_0x26f445[_0x77b3('0x12')]){throw new Error(_0x77b3('0x25'));}if(_0x48adca[_0x77b3('0x26')]===_0x804b7['id']){return _0x804b7;}else{return db[_0x77b3('0x27')][_0x77b3('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x17b4ec){if(!_0x17b4ec){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x29'));}if(!_0x17b4ec[_0x77b3('0xd')]||!_0x17b4ec[_0x77b3('0xe')]){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x2a'));}_0x16692f=_0x17b4ec;logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x2b'),_0x13bc8e['id']));return sentiment(_0x16692f[_0x77b3('0xd')],_0x16692f[_0x77b3('0xe')],_0x48adca[_0x77b3('0x2c')],_0x26f445['fileText'],_0x48adca['language']);})[_0x77b3('0xf')](function(_0x5ed77f){logger['info'](util['format'](_0x77b3('0x2d'),_0x13bc8e['id']));return _0x13bc8e[_0x77b3('0x2e')]({'sentiment':_0x5ed77f[_0x77b3('0x2f')],'sPositive':_0x5ed77f[_0x77b3('0x30')]['Positive'],'sNegative':_0x5ed77f[_0x77b3('0x30')][_0x77b3('0x31')],'sMixed':_0x5ed77f[_0x77b3('0x30')][_0x77b3('0x32')],'sNeutral':_0x5ed77f['SentimentScore'][_0x77b3('0x33')]});})[_0x77b3('0xf')](function(){logger['info'](util['format'](_0x77b3('0x1c'),_0x13bc8e['id']));_0x3ee308();});case _0x77b3('0x34'):return _0x13bc8e['update']({'transcribeStatus':_0x77b3('0x34'),'failureReason':_0x1c995c['TranscriptionJob'][_0x77b3('0x35')]})[_0x77b3('0xf')](function(){logger[_0x77b3('0x9')](util['format'](_0x77b3('0x1c'),_0x13bc8e['id']));_0x3ee308();});default:logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x36'),_0x13bc8e['id']));break;}}else{return BPromise['resolve']()[_0x77b3('0xf')](function(){if(!_0x13bc8e[_0x77b3('0x1d')]){throw new db['Sequelize'][(_0x77b3('0x23'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x48adca[_0x77b3('0x20')]||!_0x48adca[_0x77b3('0x26')]||!_0x48adca[_0x77b3('0x2c')]||!_0x48adca[_0x77b3('0x21')]||!_0x48adca[_0x77b3('0x22')]){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x24'));}if(!_0x13bc8e[_0x77b3('0x12')]){throw new Error(_0x77b3('0x25'));}if(_0x48adca[_0x77b3('0x26')]===_0x804b7['id']){return _0x804b7;}else{return db[_0x77b3('0x27')][_0x77b3('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x77b3('0xf')](function(_0x10568f){if(!_0x10568f){throw new db[(_0x77b3('0x1e'))]['ValidationError'](_0x77b3('0x29'));}if(!_0x10568f['data1']||!_0x10568f[_0x77b3('0xe')]){throw new db['Sequelize'][(_0x77b3('0x23'))](_0x77b3('0x2a'));}_0x16692f=_0x10568f;logger[_0x77b3('0x9')](util[_0x77b3('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x13bc8e['id']));return sentiment(_0x16692f[_0x77b3('0xd')],_0x16692f[_0x77b3('0xe')],_0x48adca[_0x77b3('0x2c')],_0x13bc8e[_0x77b3('0x12')],_0x48adca['language']);})[_0x77b3('0xf')](function(_0x5bba05){logger['info'](util[_0x77b3('0xa')](_0x77b3('0x2d'),_0x13bc8e['id']));return _0x13bc8e[_0x77b3('0x2e')]({'sentiment':_0x5bba05[_0x77b3('0x2f')],'sPositive':_0x5bba05[_0x77b3('0x30')][_0x77b3('0x37')],'sNegative':_0x5bba05[_0x77b3('0x30')][_0x77b3('0x31')],'sMixed':_0x5bba05['SentimentScore'][_0x77b3('0x32')],'sNeutral':_0x5bba05[_0x77b3('0x30')][_0x77b3('0x33')],'transcribeStatus':'COMPLETED'});})[_0x77b3('0xf')](function(){logger[_0x77b3('0x9')](util[_0x77b3('0xa')](_0x77b3('0x1c'),_0x13bc8e['id']));_0x3ee308();});}})[_0x77b3('0x38')](function(_0x2f373a){if(_0x2f373a){if(!_0x2f373a[_0x77b3('0x39')]||_0x2f373a[_0x77b3('0x39')]!==_0x77b3('0x3a')){logger[_0x77b3('0x3b')](util[_0x77b3('0xa')](_0x77b3('0x3c'),_0x13bc8e['id']),util[_0x77b3('0x3d')](_0x2f373a,{'showHidden':![],'depth':null}));}}_0x3ee308();});});}function checkTranscribe(){var _0xe26db1;var _0xc8b1bb;var _0x127a14;return db['VoiceRecording'][_0x77b3('0x3e')]({'where':{'transcribeStatus':_0x77b3('0x3f')}})[_0x77b3('0xf')](function(_0x45c38b){if(!_0x45c38b||!_0x45c38b[_0x77b3('0x19')]){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x40'));}_0xe26db1=_0x45c38b;return db['Setting'][_0x77b3('0x28')]({'where':{'id':0x1}});})[_0x77b3('0xf')](function(_0x1cdff7){if(!_0x1cdff7){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x41'));}_0xc8b1bb=_0x1cdff7;if(!_0xc8b1bb[_0x77b3('0x42')]||!_0xc8b1bb[_0x77b3('0x43')]||!_0xc8b1bb[_0x77b3('0x44')]||!_0xc8b1bb[_0x77b3('0x21')]||!_0xc8b1bb[_0x77b3('0x22')]){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x45'));}return db[_0x77b3('0x27')][_0x77b3('0x28')]({'where':{'id':_0xc8b1bb['transcribeAccountId']}});})['then'](function(_0x142aff){if(!_0x142aff){throw new db[(_0x77b3('0x1e'))][(_0x77b3('0x23'))](_0x77b3('0x29'));}if(!_0x142aff[_0x77b3('0xd')]||!_0x142aff[_0x77b3('0xe')]){throw new db['Sequelize'][(_0x77b3('0x23'))](_0x77b3('0x2a'));}_0x127a14=_0x142aff;var _0x280eb7=[];_0xe26db1['forEach'](function(_0x106309){_0x280eb7[_0x77b3('0x46')](checkTranscribeJob(_0x106309,_0xc8b1bb,_0x127a14));});return BPromise[_0x77b3('0x47')](_0x280eb7);})[_0x77b3('0x38')](function(_0x3dd7b9){if(_0x3dd7b9){if(!_0x3dd7b9['name']||_0x3dd7b9[_0x77b3('0x39')]!==_0x77b3('0x3a')){logger[_0x77b3('0x3b')](util[_0x77b3('0x3d')](_0x3dd7b9,{'showHidden':![],'depth':null}));}}});}exports[_0x77b3('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x7334=['[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','COMPLETED','catch','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','name','SequelizeValidationError','error','start','lodash','aws-sdk','request-promise','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','Sequelize','Sentiment\x20Analysis\x20not\x20requested','language','bucket','ValidationError','sentimentAccountId','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason'];(function(_0x4caaeb,_0x21e0e3){var _0x24b704=function(_0x178630){while(--_0x178630){_0x4caaeb['push'](_0x4caaeb['shift']());}};_0x24b704(++_0x21e0e3);}(_0x7334,0x184));var _0x4733=function(_0x39a806,_0xe618ab){_0x39a806=_0x39a806-0x0;var _0x46496f=_0x7334[_0x39a806];return _0x46496f;};var _=require(_0x4733('0x0'));var AWS=require(_0x4733('0x1'));var rp=require(_0x4733('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x4733('0x3'))['db'];var logger=require('../../config/logger')(_0x4733('0x4'));function getTranscriptionJob(_0x218143,_0x3645a2,_0x29d7da,_0x2b146d){return new Promise(function(_0x449ead,_0x16d7cc){var _0x283754=new AWS[(_0x4733('0x5'))]({'accessKeyId':_0x3645a2,'secretAccessKey':_0x218143,'region':_0x29d7da});_0x283754[_0x4733('0x6')]({'TranscriptionJobName':_0x2b146d},function(_0x8257cf,_0x3562b7){if(_0x8257cf){return _0x16d7cc(_0x8257cf);}else{return _0x449ead(_0x3562b7);}});});}function sentiment(_0x4c5c0,_0x38b7f5,_0x2d5fde,_0x1bc511,_0x2bafad){return new Promise(function(_0x49032d,_0x42b97f){var _0x1e6fcf=new AWS['Comprehend']({'accessKeyId':_0x38b7f5,'secretAccessKey':_0x4c5c0,'region':_0x2d5fde});_0x1e6fcf[_0x4733('0x7')]({'Text':_0x1bc511,'LanguageCode':_0x2bafad['substring'](0x0,0x2)},function(_0xa8e91b,_0x380b2e){if(_0xa8e91b){return _0x42b97f(_0xa8e91b);}else{return _0x49032d(_0x380b2e);}});});}function checkTranscribeJob(_0x44cb92,_0x461f74,_0x100ecd){var _0x1c146c;return new BPromise(function(_0x2c0f6b,_0x5e4b06){logger[_0x4733('0x8')](util['format'](_0x4733('0x9'),_0x44cb92['id'],_0x44cb92[_0x4733('0xa')]));return getTranscriptionJob(_0x100ecd[_0x4733('0xb')],_0x100ecd[_0x4733('0xc')],_0x461f74[_0x4733('0xd')],_0x44cb92[_0x4733('0xa')])[_0x4733('0xe')](function(_0x9fff){logger[_0x4733('0x8')](util['format'](_0x4733('0xf'),_0x44cb92['id'],_0x44cb92[_0x4733('0xa')],_0x9fff['TranscriptionJob'][_0x4733('0x10')]));if(!_0x44cb92[_0x4733('0x11')]){switch(_0x9fff[_0x4733('0x12')][_0x4733('0x10')]){case'COMPLETED':var _0x517fbc={'transcribeStatus':_0x9fff[_0x4733('0x12')][_0x4733('0x10')],'fileUri':_0x9fff['TranscriptionJob'][_0x4733('0x13')][_0x4733('0x14')]};logger[_0x4733('0x8')](util[_0x4733('0x15')]('[RECORDING:%d]\x20Get\x20transcript',_0x44cb92['id']));return rp({'uri':_0x9fff[_0x4733('0x12')][_0x4733('0x13')]['TranscriptFileUri'],'json':!![]})[_0x4733('0xe')](function(_0x18da47){logger['info'](util[_0x4733('0x15')](_0x4733('0x16'),_0x44cb92['id']));if(_0x18da47&&_0x18da47[_0x4733('0x17')]&&_0x18da47[_0x4733('0x17')][_0x4733('0x18')]&&_0x18da47[_0x4733('0x17')][_0x4733('0x18')][_0x4733('0x19')]){_0x517fbc['fileText']='';for(var _0x3e6976=0x0;_0x3e6976<_0x18da47[_0x4733('0x17')][_0x4733('0x18')][_0x4733('0x19')];_0x3e6976++){_0x517fbc[_0x4733('0x11')]+=_0x18da47[_0x4733('0x17')][_0x4733('0x18')][_0x3e6976][_0x4733('0x1a')]+'';}}return _0x44cb92[_0x4733('0x1b')](_0x517fbc);})[_0x4733('0xe')](function(){logger['info'](util[_0x4733('0x15')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x44cb92['id']));if(!_0x44cb92['tempSentiment']){throw new db[(_0x4733('0x1c'))]['ValidationError'](_0x4733('0x1d'));}if(!_0x461f74['sentiment']||!_0x461f74['sentimentAccountId']||!_0x461f74['sentimentRegion']||!_0x461f74[_0x4733('0x1e')]||!_0x461f74[_0x4733('0x1f')]){throw new db[(_0x4733('0x1c'))][(_0x4733('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x517fbc['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x461f74[_0x4733('0x21')]===_0x100ecd['id']){return _0x100ecd;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x4733('0x21')]}});}})[_0x4733('0xe')](function(_0xa915ce){if(!_0xa915ce){throw new db['Sequelize']['ValidationError'](_0x4733('0x22'));}if(!_0xa915ce[_0x4733('0xb')]||!_0xa915ce[_0x4733('0xc')]){throw new db[(_0x4733('0x1c'))][(_0x4733('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x1c146c=_0xa915ce;logger[_0x4733('0x8')](util[_0x4733('0x15')](_0x4733('0x23'),_0x44cb92['id']));return sentiment(_0x1c146c[_0x4733('0xb')],_0x1c146c[_0x4733('0xc')],_0x461f74['sentimentRegion'],_0x517fbc['fileText'],_0x461f74[_0x4733('0x1e')]);})[_0x4733('0xe')](function(_0x404dd7){logger[_0x4733('0x8')](util[_0x4733('0x15')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x44cb92['id']));return _0x44cb92[_0x4733('0x1b')]({'sentiment':_0x404dd7[_0x4733('0x24')],'sPositive':_0x404dd7[_0x4733('0x25')]['Positive'],'sNegative':_0x404dd7[_0x4733('0x25')][_0x4733('0x26')],'sMixed':_0x404dd7[_0x4733('0x25')][_0x4733('0x27')],'sNeutral':_0x404dd7[_0x4733('0x25')][_0x4733('0x28')]});})[_0x4733('0xe')](function(){logger[_0x4733('0x8')](util['format'](_0x4733('0x29'),_0x44cb92['id']));_0x2c0f6b();});case'FAILED':return _0x44cb92[_0x4733('0x1b')]({'transcribeStatus':_0x4733('0x2a'),'failureReason':_0x9fff[_0x4733('0x12')][_0x4733('0x2b')]})[_0x4733('0xe')](function(){logger[_0x4733('0x8')](util[_0x4733('0x15')](_0x4733('0x29'),_0x44cb92['id']));_0x2c0f6b();});default:logger['info'](util[_0x4733('0x15')](_0x4733('0x2c'),_0x44cb92['id']));break;}}else{return BPromise['resolve']()[_0x4733('0xe')](function(){if(!_0x44cb92[_0x4733('0x2d')]){throw new db['Sequelize'][(_0x4733('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x461f74[_0x4733('0x2e')]||!_0x461f74['sentimentAccountId']||!_0x461f74[_0x4733('0x2f')]||!_0x461f74[_0x4733('0x1e')]||!_0x461f74['bucket']){throw new db['Sequelize'][(_0x4733('0x20'))](_0x4733('0x30'));}if(!_0x44cb92['fileText']){throw new Error(_0x4733('0x31'));}if(_0x461f74[_0x4733('0x21')]===_0x100ecd['id']){return _0x100ecd;}else{return db[_0x4733('0x32')][_0x4733('0x33')]({'where':{'id':_settings[_0x4733('0x21')]}});}})[_0x4733('0xe')](function(_0x23e355){if(!_0x23e355){throw new db[(_0x4733('0x1c'))][(_0x4733('0x20'))](_0x4733('0x22'));}if(!_0x23e355[_0x4733('0xb')]||!_0x23e355[_0x4733('0xc')]){throw new db[(_0x4733('0x1c'))][(_0x4733('0x20'))](_0x4733('0x34'));}_0x1c146c=_0x23e355;logger[_0x4733('0x8')](util[_0x4733('0x15')](_0x4733('0x23'),_0x44cb92['id']));return sentiment(_0x1c146c['data1'],_0x1c146c[_0x4733('0xc')],_0x461f74[_0x4733('0x2f')],_0x44cb92[_0x4733('0x11')],_0x461f74[_0x4733('0x1e')]);})[_0x4733('0xe')](function(_0x3bbe48){logger[_0x4733('0x8')](util[_0x4733('0x15')](_0x4733('0x35'),_0x44cb92['id']));return _0x44cb92[_0x4733('0x1b')]({'sentiment':_0x3bbe48[_0x4733('0x24')],'sPositive':_0x3bbe48[_0x4733('0x25')][_0x4733('0x36')],'sNegative':_0x3bbe48[_0x4733('0x25')]['Negative'],'sMixed':_0x3bbe48['SentimentScore'][_0x4733('0x27')],'sNeutral':_0x3bbe48[_0x4733('0x25')][_0x4733('0x28')],'transcribeStatus':_0x4733('0x37')});})[_0x4733('0xe')](function(){logger[_0x4733('0x8')](util[_0x4733('0x15')](_0x4733('0x29'),_0x44cb92['id']));_0x2c0f6b();});}})[_0x4733('0x38')](function(_0x9da1a8){if(_0x9da1a8){if(!_0x9da1a8['name']||_0x9da1a8['name']!=='SequelizeValidationError'){logger['error'](util[_0x4733('0x15')](_0x4733('0x39'),_0x44cb92['id']),util[_0x4733('0x3a')](_0x9da1a8,{'showHidden':![],'depth':null}));}}_0x2c0f6b();});});}function checkTranscribe(){var _0x984462;var _0xf3c650;var _0x45b9cf;return db[_0x4733('0x3b')][_0x4733('0x3c')]({'where':{'transcribeStatus':_0x4733('0x3d')}})[_0x4733('0xe')](function(_0x4ea363){if(!_0x4ea363||!_0x4ea363['length']){throw new db[(_0x4733('0x1c'))]['ValidationError'](_0x4733('0x3e'));}_0x984462=_0x4ea363;return db[_0x4733('0x3f')][_0x4733('0x33')]({'where':{'id':0x1}});})['then'](function(_0x3f2a78){if(!_0x3f2a78){throw new db[(_0x4733('0x1c'))][(_0x4733('0x20'))](_0x4733('0x40'));}_0xf3c650=_0x3f2a78;if(!_0xf3c650[_0x4733('0x4')]||!_0xf3c650[_0x4733('0x41')]||!_0xf3c650[_0x4733('0xd')]||!_0xf3c650[_0x4733('0x1e')]||!_0xf3c650[_0x4733('0x1f')]){throw new db['Sequelize'][(_0x4733('0x20'))](_0x4733('0x42'));}return db[_0x4733('0x32')]['findOne']({'where':{'id':_0xf3c650[_0x4733('0x41')]}});})[_0x4733('0xe')](function(_0xafb3f8){if(!_0xafb3f8){throw new db[(_0x4733('0x1c'))]['ValidationError'](_0x4733('0x22'));}if(!_0xafb3f8['data1']||!_0xafb3f8[_0x4733('0xc')]){throw new db[(_0x4733('0x1c'))][(_0x4733('0x20'))](_0x4733('0x34'));}_0x45b9cf=_0xafb3f8;var _0x53321d=[];_0x984462['forEach'](function(_0x4619f7){_0x53321d[_0x4733('0x43')](checkTranscribeJob(_0x4619f7,_0xf3c650,_0x45b9cf));});return BPromise['all'](_0x53321d);})['catch'](function(_0x46a31c){if(_0x46a31c){if(!_0x46a31c[_0x4733('0x44')]||_0x46a31c[_0x4733('0x44')]!==_0x4733('0x45')){logger[_0x4733('0x46')](util[_0x4733('0x3a')](_0x46a31c,{'showHidden':![],'depth':null}));}}});}exports[_0x4733('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file