Skip to content

Commit

Permalink
Allow #upload{} as a insert_file parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
mworrell committed Jan 25, 2011
1 parent d5e3b3e commit a4afe4c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/models/m_media.erl
Expand Up @@ -204,6 +204,10 @@ replace(Id, Props, Context) ->
insert_file(File, Context) ->
insert_file(File, [], Context).

insert_file(#upload{filename=OriginalFilename, tmpfile=TmpFile}, Props, Context) ->
PropsMedia = add_medium_info(TmpFile, OriginalFilename, [{original_filename, OriginalFilename}], Context),
insert_file(TmpFile, [{original_filename, OriginalFilename}|Props], PropsMedia, Context);

insert_file(File, Props, Context) ->
OriginalFilename = proplists:get_value(original_filename, Props, File),
PropsMedia = add_medium_info(File, OriginalFilename, [{original_filename, OriginalFilename}], Context),
Expand Down

0 comments on commit a4afe4c

Please sign in to comment.