Skip to content

Commit

Permalink
don't call is_tts_changed on PUT (2600hz#4674)
Browse files Browse the repository at this point in the history
  • Loading branch information
icehess authored and k-anderson committed Mar 20, 2018
1 parent 51443f9 commit 287473a
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions applications/crossbar/src/modules/cb_media.erl
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,11 @@ post_media_binary(Context, MediaId, 'undefined') ->
post_media_binary(Context, MediaId, _AccountId) ->
update_media_binary(Context, MediaId).

create_update_tts(Context, CreateOrUpdate) ->
C1 = maybe_create_tts_media_doc(Context, CreateOrUpdate),
maybe_update_media_file(C1, CreateOrUpdate, is_tts_changed(cb_context:doc(C1)), cb_context:resp_status(C1)).

maybe_create_tts_media_doc(Context, <<"create">>) ->
update_and_save_tts_doc(Context);
maybe_create_tts_media_doc(Context, _) ->
Context.
create_update_tts(Context, <<"create">>) ->
C1 = update_and_save_tts_doc(Context),
maybe_update_media_file(C1, <<"create">>, 'true', cb_context:resp_status(C1));
create_update_tts(Context, <<"update">>) ->
maybe_update_media_file(Context, <<"update">>, is_tts_changed(cb_context:doc(Context)), cb_context:resp_status(Context)).

-spec maybe_update_media_file(cb_context:context(), kz_term:ne_binary(), boolean(), crossbar_status()) ->
cb_context:context().
Expand Down

0 comments on commit 287473a

Please sign in to comment.