Skip to content

Commit

Permalink
Also accept regular File object
Browse files Browse the repository at this point in the history
  • Loading branch information
bo-oz committed Apr 13, 2018
1 parent bf1c9f4 commit 2eb3285
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/vimeo_me2/user/upload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ def pull_upload name, link, options = {}

def change_name name = nil
video = VimeoMe2::Video.new(@token, @ticket['uri'])
video.name = name || @video.original_filename
video.name = name || get_file_name
video.update
end

def get_file_name
return @video.path if @video.is_a? File
return @video.original_filename
end

# 3.4 Update
def create_video
tus = {approach: 'tus', size: @video.size.to_s}
Expand Down

0 comments on commit 2eb3285

Please sign in to comment.