-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add chunked-upload and support for audio/video processing #12
Conversation
case File.stat(local_file) do | ||
{:ok, %{size: file_size, type: :regular}} -> | ||
File.stream!(local_file, [], @default_block_size) | ||
|> Stream.map(fn(blk) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about extract this anonymous function to a function in a module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that anonymous function is explicit enough: A block |> chop |> upload
. That does't deserve a independence function, and really hard to name it 😜
lib/qiniu/chunk_upload.ex
Outdated
end | ||
|
||
def send_chunk([], _offset, ctx, _uptoken, _host), do: ctx | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to delete this blank line for this kind of function.
lib/qiniu/fop/av.ex
Outdated
alias Qiniu.HTTP | ||
|
||
def avthumb(bucket_name, key, opts \\ []) do | ||
query_opts = opts |> Keyword.take([:"notifyURL", :pipeline]) |> Enum.into(%{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use : notifyURL
directly? And the one on next line.
lib/qiniu/fop/av.ex
Outdated
fops: trans_fops(fog_opts), | ||
} | ||
|> Map.merge(query_opts) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that it can be changed to?
%{...}
|> Map.merge(query_opts)
|> URI.encode_query
- reduce blank lines for single-line `def`s - style: direct use `:notifyURL` - pipline funs calling
merged. And 0.4.0 is published with this feature. Thank you! |
Qiniu Chunked-Upload
Qiniu AV Processing