kopia lustrzana https://github.com/OpenDroneMap/NodeODM
Merge branch 'master' of https://github.com/pepperlk/node-OpenDroneMap
commit
c4d8e748ca
22
index.js
22
index.js
|
@ -167,7 +167,7 @@ app.post('/task/new', addRequestId, upload.array('images'), (req, res) => {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Unzips zip URL to data/<uuid>/ (if any)
|
// Unzips zip URL to tmp/<uuid>/ (if any)
|
||||||
cb => {
|
cb => {
|
||||||
if (req.body.zipurl) {
|
if (req.body.zipurl) {
|
||||||
let archive = "zipurl.zip";
|
let archive = "zipurl.zip";
|
||||||
|
@ -177,23 +177,7 @@ app.post('/task/new', addRequestId, upload.array('images'), (req, res) => {
|
||||||
else{
|
else{
|
||||||
let archiveDestPath = path.join(dstPath, archive);
|
let archiveDestPath = path.join(dstPath, archive);
|
||||||
|
|
||||||
download(req.body.zipurl, archiveDestPath, err => {
|
download(req.body.zipurl, archiveDestPath, cb);
|
||||||
if (err) cb(err);
|
|
||||||
else{
|
|
||||||
// unzip and flatten the zip file (in case there are folders in the zip)
|
|
||||||
// fs.createReadStream(archiveDestPath).pipe(unzip.Parse())
|
|
||||||
// .on('entry', function(entry) {
|
|
||||||
// if (entry.type === 'File') {
|
|
||||||
// entry.pipe(fs.createWriteStream(path.join(srcPath, path.basename(entry.path))));
|
|
||||||
// } else {
|
|
||||||
// entry.autodrain();
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .on('close', cb)
|
|
||||||
// .on('error', cb);
|
|
||||||
cb();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -213,8 +197,6 @@ app.post('/task/new', addRequestId, upload.array('images'), (req, res) => {
|
||||||
else {
|
else {
|
||||||
async.eachSeries(entries, (entry, cb) => {
|
async.eachSeries(entries, (entry, cb) => {
|
||||||
if (/\.zip$/gi.test(entry)) {
|
if (/\.zip$/gi.test(entry)) {
|
||||||
|
|
||||||
|
|
||||||
fs.createReadStream(path.join(destImagesPath, entry)).pipe(unzip.Parse())
|
fs.createReadStream(path.join(destImagesPath, entry)).pipe(unzip.Parse())
|
||||||
.on('entry', function(entry) {
|
.on('entry', function(entry) {
|
||||||
if (entry.type === 'File') {
|
if (entry.type === 'File') {
|
||||||
|
|
Ładowanie…
Reference in New Issue