正在显示
1 个修改的文件
包含
13 行增加
和
9 行删除
| @@ -47,25 +47,29 @@ recordInfoService.prototype.tencentRecordInfo = async(channelId)=>{ | @@ -47,25 +47,29 @@ recordInfoService.prototype.tencentRecordInfo = async(channelId)=>{ | ||
| 47 | 47 | ||
| 48 | recordInfoService.prototype.getRecordFileURL = async(path,time)=>{ | 48 | recordInfoService.prototype.getRecordFileURL = async(path,time)=>{ |
| 49 | try { | 49 | try { |
| 50 | - let onlinePath = '/netWorkSchool/Agora_Recording_SDK_for_Linux_FULL/samples/' | ||
| 51 | - //let onlinePath = '/Users/fzy/Downloads/Agora_Recording_SDK_for_Linux_FULL/samples/' | 50 | + //let onlinePath = '/netWorkSchool/Agora_Recording_SDK_for_Linux_FULL/samples/' |
| 51 | + let onlinePath = '/Users/fzy/Downloads/Agora_Recording_SDK_for_Linux_FULL/samples/' | ||
| 52 | var backFile=[]; | 52 | var backFile=[]; |
| 53 | var fileU | 53 | var fileU |
| 54 | let addrecord = await recordInfo.findAll({where:{channel:path}}); | 54 | let addrecord = await recordInfo.findAll({where:{channel:path}}); |
| 55 | console.log('录制文件',addrecord) | 55 | console.log('录制文件',addrecord) |
| 56 | let noFile = []; | 56 | let noFile = []; |
| 57 | var allFile = []; | 57 | var allFile = []; |
| 58 | + var channefiles = []; | ||
| 58 | addrecord.forEach(function(record,top){ | 59 | addrecord.forEach(function(record,top){ |
| 59 | let date1 = moment(Number( record.createTime)).format('YYYYMMDD') | 60 | let date1 = moment(Number( record.createTime)).format('YYYYMMDD') |
| 60 | let date2 = moment(Number(record.createTime)-8*60*60*1000).format('YYYYMMDDhhmmss') | 61 | let date2 = moment(Number(record.createTime)-8*60*60*1000).format('YYYYMMDDhhmmss') |
| 61 | let channeFile = onlinePath+date1; | 62 | let channeFile = onlinePath+date1; |
| 62 | var fschannefiles=fs.readdirSync(channeFile); | 63 | var fschannefiles=fs.readdirSync(channeFile); |
| 64 | + if(top == 1){ | ||
| 65 | + channefiles=fschannefiles; | ||
| 66 | + } | ||
| 63 | fschannefiles.forEach(function(cfile,index){ | 67 | fschannefiles.forEach(function(cfile,index){ |
| 64 | if(record.channel == cfile.split('_')[0]+'_'+cfile.split("_")[1]){ | 68 | if(record.channel == cfile.split('_')[0]+'_'+cfile.split("_")[1]){ |
| 65 | let pathURL = onlinePath+date1+"/"+cfile; | 69 | let pathURL = onlinePath+date1+"/"+cfile; |
| 66 | let files=fs.readdirSync(pathURL); | 70 | let files=fs.readdirSync(pathURL); |
| 67 | if(top == 1){ | 71 | if(top == 1){ |
| 68 | - allFile.push(files); | 72 | + allFile=files; |
| 69 | } | 73 | } |
| 70 | files.forEach(function(file){ | 74 | files.forEach(function(file){ |
| 71 | let type = file.split('.'); | 75 | let type = file.split('.'); |
| @@ -74,11 +78,11 @@ recordInfoService.prototype.getRecordFileURL = async(path,time)=>{ | @@ -74,11 +78,11 @@ recordInfoService.prototype.getRecordFileURL = async(path,time)=>{ | ||
| 74 | }else{ | 78 | }else{ |
| 75 | let noFile = []; | 79 | let noFile = []; |
| 76 | let fileN = type[0].split('_'); | 80 | let fileN = type[0].split('_'); |
| 77 | - console.log('++++++++=========',fileN[1]) | ||
| 78 | - console.log(moment(fileN[1], "YYYYMMDDhhmmss").format("X"),record.createTime) | ||
| 79 | - console.log(date2,record.status) | ||
| 80 | - console.log(record.id); | ||
| 81 | - console.log(fileN[1].slice(0,fileN[1].length-3),date2==fileN[1].slice(0,fileN[1].length-3)) | 81 | + // console.log('++++++++=========',fileN[1]) |
| 82 | + // console.log(moment(fileN[1], "YYYYMMDDhhmmss").format("X"),record.createTime) | ||
| 83 | + // console.log(date2,record.status) | ||
| 84 | + // console.log(record.id); | ||
| 85 | + // console.log(fileN[1].slice(0,fileN[1].length-3),date2==fileN[1].slice(0,fileN[1].length-3)) | ||
| 82 | if(date2==fileN[1].slice(0,fileN[1].length-3)){ | 86 | if(date2==fileN[1].slice(0,fileN[1].length-3)){ |
| 83 | backFile.push({ | 87 | backFile.push({ |
| 84 | channel:record.channel, | 88 | channel:record.channel, |
| @@ -117,7 +121,7 @@ recordInfoService.prototype.getRecordFileURL = async(path,time)=>{ | @@ -117,7 +121,7 @@ recordInfoService.prototype.getRecordFileURL = async(path,time)=>{ | ||
| 117 | // createTime:record.createTime, | 121 | // createTime:record.createTime, |
| 118 | // fileUrl:applacation.recordPath+date1+'/'+cfile+'/'+minFile | 122 | // fileUrl:applacation.recordPath+date1+'/'+cfile+'/'+minFile |
| 119 | // }) | 123 | // }) |
| 120 | - return {backFile:backFile,fschannefiles:allFile} | 124 | + return {backFile:backFile,fschannefiles:allFile,channefiles:channefiles} |
| 121 | } catch (error) { | 125 | } catch (error) { |
| 122 | throw error; | 126 | throw error; |
| 123 | } | 127 | } |
-
请 注册 或 登录 后发表评论