flickr-set-get
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,7 @@ | ||
1.1.1 | ||
----- | ||
- Speedup & completion of download on errors ([saemy](https://github.com/lmammino/flickr-set-get/pull/30)) | ||
- Updated mock-fs to make tests pass on node version >= 4 ([lmammino](https://github.com/lmammino/flickr-set-get/pull/32)) | ||
1.1.0 | ||
@@ -10,2 +16,2 @@ ----- | ||
First release | ||
First release |
@@ -225,7 +225,17 @@ 'use strict'; | ||
return function asyncTask(cb) { | ||
var path = _path.join(_this.options.outputDir, photoId + '.jpg'); | ||
if (_this.options.noOverwrite && fs.existsSync(path)) { | ||
_this.emit('photoSkipped', photoId, path); | ||
async.setImmediate(function onAsync() { | ||
cb(null, path); | ||
}); | ||
return; | ||
} | ||
getPhotoSizes(photoId, function onGetPhotoSizes(err, sizes) { | ||
if (err) { | ||
_this.emit('error', err); | ||
return cb(err); | ||
_this.emit('warning', err); | ||
return cb(null, path); | ||
} | ||
@@ -237,10 +247,4 @@ | ||
var sizeErr = new Error('Size "' + _this.options.size + '" not available'); | ||
_this.emit('error', sizeErr); | ||
_this.emit('warning', sizeErr); | ||
return cb(sizeErr); | ||
} | ||
var path = _path.join(_this.options.outputDir, photoId + '.jpg'); | ||
if (_this.options.noOverwrite && fs.existsSync(path)) { | ||
_this.emit('photoSkipped', photoId, path); | ||
return cb(null, path); | ||
@@ -252,4 +256,4 @@ } | ||
if (err) { | ||
_this.emit('error', err); | ||
return cb(err); | ||
_this.emit('warning', err); | ||
return cb(null, path); | ||
} | ||
@@ -256,0 +260,0 @@ |
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"author": { | ||
@@ -56,5 +56,5 @@ "name": "Luciano Mammino", | ||
"mocha-istanbul": "^0.2.0", | ||
"mock-fs": "^2.7.1", | ||
"mock-fs": "^3.11.0", | ||
"nock": "^1.9.0" | ||
} | ||
} |
@@ -178,3 +178,3 @@ 'use strict'; | ||
f.on('error', function onError(error) { | ||
f.on('warning', function onWarning(error) { | ||
rmDirSyncIfExists('temp'); | ||
@@ -181,0 +181,0 @@ if (error.message.match(/Size "Wrong size" not available/)) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
80538
1713