small fixes

This commit is contained in:
Xavier Trochu 2015-11-16 09:59:27 +01:00
parent 63aef6b832
commit 26523b011a
2 changed files with 3 additions and 4 deletions

View file

@ -3,6 +3,7 @@ fs = require("fs")
LocalFileWriter = require("./LocalFileWriter")
Errors = require('./Errors')
rimraf = require("rimraf")
_ = require "underscore"
filterName = (key) ->
return key.replace /\//g, "_"
@ -29,9 +30,7 @@ module.exports =
# opts may be {start: Number, end: Number}
getFileStream: (location, name, opts, _callback = (err, res)->) ->
callback = (args...) ->
_callback(args...)
_callback = () ->
callback = _.once _callback
filteredName = filterName name
logger.log location:location, name:filteredName, "getting file"
sourceStream = fs.createReadStream "#{location}/#{filteredName}", opts

View file

@ -63,7 +63,7 @@ module.exports =
PersistorManager.getFileStream bucket, convertedKey, callback
_convertFile: (bucket, originalKey, opts, callback)->
@_writeS3FileToDisk bucket, originalKey, (err, originalFsPath)->
@_writeS3FileToDisk bucket, originalKey, opts, (err, originalFsPath)->
if err?
return callback(err)
done = (err, destPath)->