From b79eb2fdd3019836d861e35cd981af9e0571cb5f Mon Sep 17 00:00:00 2001 From: Jon Ursenbach Date: Fri, 9 Nov 2018 09:14:13 -0500 Subject: [PATCH] 2.1.1 changelog --- CHANGELOG.md | 5 +++++ lib/vimeo.js | 18 ++++++++---------- package.json | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 741bba6..a34ccdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [2.1.1] - 2018-11-09 +## Added +- Upload and replace methods now support file blogs. ([#86](https://github.com/vimeo/vimeo.js/pull/86), [@nicolastakashi](https://github.com/nicolastakashi)) + ## [2.1.0] - 2018-04-03 ## Changed - Upgrading [tus-js-client](https://www.npmjs.com/package/tus-js-client) to `^1.5.1`. ([#73](https://github.com/vimeo/vimeo.js/issues/73)) @@ -48,6 +52,7 @@ ### Added - First release. +[2.1.1]: https://github.com/vimeo/vimeo.js/compare/2.1.0...2.1.1 [2.1.0]: https://github.com/vimeo/vimeo.js/compare/2.0.2...2.1.0 [2.0.2]: https://github.com/vimeo/vimeo.js/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/vimeo/vimeo.js/compare/2.0.0...2.0.1 diff --git a/lib/vimeo.js b/lib/vimeo.js index 07669b1..7175ad5 100644 --- a/lib/vimeo.js +++ b/lib/vimeo.js @@ -31,7 +31,7 @@ module.exports.request_defaults = { query: {}, headers: { Accept: 'application/vnd.vimeo.*+json;version=3.4', - 'User-Agent': 'Vimeo.js/2.1.0' + 'User-Agent': 'Vimeo.js/2.1.1' } } @@ -433,14 +433,14 @@ Vimeo.prototype.upload = function ( params = {} } - if(typeof file === 'string') { + if (typeof file === 'string') { try { fileSize = fs.statSync(file).size } catch (e) { return errorCallback('Unable to locate file to upload.') - } else { - fileSize = file.size } + } else { + fileSize = file.size } // Ignore any specified upload approach and size. @@ -509,14 +509,13 @@ Vimeo.prototype.replace = function ( params = {} } - - if(typeof file === 'string') { + if (typeof file === 'string') { try { fileSize = fs.statSync(file).size } catch (e) { return errorCallback('Unable to locate file to upload.') } - + params.file_name = path.basename(file) } else { fileSize = file.size @@ -579,13 +578,12 @@ Vimeo.prototype._performTusUpload = function ( progressCallback, errorCallback ) { - var fileUpload = file - if(typeof file === 'string') { + if (typeof file === 'string') { fileUpload = fs.createReadStream(file) } - + var upload = new tus.Upload(fileUpload, { endpoint: 'none', uploadSize: fileSize, diff --git a/package.json b/package.json index d663a64..5766287 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vimeo", - "version": "2.1.0", + "version": "2.1.1", "license": "Apache-2.0", "description": "A Node.js library for the new Vimeo API.", "homepage": "https://developer.vimeo.com/",