Skip to content
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

Merged
merged 7 commits into from
Jul 19, 2017

Conversation

beams0305
Copy link
Contributor

case File.stat(local_file) do
{:ok, %{size: file_size, type: :regular}} ->
File.stream!(local_file, [], @default_block_size)
|> Stream.map(fn(blk) ->
Copy link
Owner

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?

Copy link
Contributor

@xingxing xingxing Jul 19, 2017

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 😜

end

def send_chunk([], _offset, ctx, _uptoken, _host), do: ctx

Copy link
Owner

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.

alias Qiniu.HTTP

def avthumb(bucket_name, key, opts \\ []) do
query_opts = opts |> Keyword.take([:"notifyURL", :pipeline]) |> Enum.into(%{})
Copy link
Owner

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.

fops: trans_fops(fog_opts),
}
|> Map.merge(query_opts)
)
Copy link
Owner

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

Repository owner deleted a comment from coveralls Jul 18, 2017
Repository owner deleted a comment from coveralls Jul 18, 2017
Repository owner deleted a comment from coveralls Jul 18, 2017
Repository owner deleted a comment from coveralls Jul 18, 2017
Repository owner deleted a comment from coveralls Jul 18, 2017
Wade Xing and others added 2 commits July 19, 2017 11:00
- reduce blank lines for single-line `def`s
- style: direct use `:notifyURL`
- pipline funs calling
@tony612 tony612 merged commit fa49639 into tony612:master Jul 19, 2017
@tony612
Copy link
Owner

tony612 commented Jul 19, 2017

merged. And 0.4.0 is published with this feature. Thank you!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants