Skip to content

Commit

Permalink
2.1.1 changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Ursenbach committed Nov 9, 2018
1 parent 1927074 commit b79eb2f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down Expand Up @@ -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
Expand Down
18 changes: 8 additions & 10 deletions lib/vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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/",
Expand Down

0 comments on commit b79eb2f

Please sign in to comment.