Skip to content

Fix request content type and response parsing #11

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

Merged
merged 3 commits into from
Apr 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
*.jar
*.war
*.ear
/target
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void setRestTemplate(RestTemplate rt) {
private HttpHeaders getHeaders() {
HttpHeaders headers = new HttpHeaders();
headers.add("Accept", "application/json");
headers.add("Content-Type", "application/json");
headers.add("Content-Type", "application/json; charset=utf-8");
headers.add("Zencoder-Api-Key", api_key);
headers.add("User-Agent", "zencoder-java-2.0");
return headers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public enum State {
FAILED("failed"),
CANCELLED("cancelled"),
NO_INPUT("no_input"),
UPLOADING("uploading"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the int to long changes but not sure what the context of this is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue #10 prompted this change; customer reported encountering an exception while parsing responses for outputs that were in an 'uploading' state.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok got it. lgtm

SKIPPED("skipped");

private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@ public class ZencoderMediaFile {

private ContainerFormat format;
private Long duration_in_ms;
private Integer total_bitrate_in_kbps;
private Long total_bitrate_in_kbps;

private Long file_size_in_bytes;
private String md5_checksum;

private Integer height;
private Integer width;
private VideoCodec video_codec;
private Integer video_bitrate_in_kbps;
private Long video_bitrate_in_kbps;
private Double frame_rate;

private AudioCodec audio_codec;
private Integer audio_bitrate_in_kbps;
private Long audio_bitrate_in_kbps;
private Integer audio_sample_rate;
private Integer channels;

Expand Down Expand Up @@ -227,11 +227,11 @@ public void setDurationInMs(Long duration_in_ms) {
this.duration_in_ms = duration_in_ms;
}

public Integer getTotalBitrateInKbps() {
public Long getTotalBitrateInKbps() {
return total_bitrate_in_kbps;
}

public void setTotalBitrateInKbps(Integer total_bitrate_in_kbps) {
public void setTotalBitrateInKbps(Long total_bitrate_in_kbps) {
this.total_bitrate_in_kbps = total_bitrate_in_kbps;
}

Expand Down Expand Up @@ -299,11 +299,11 @@ public void setVideoCodec(VideoCodec video_codec) {
this.video_codec = video_codec;
}

public Integer getVideoBitrateInKbps() {
public Long getVideoBitrateInKbps() {
return video_bitrate_in_kbps;
}

public void setVideoBitrateInKbps(Integer video_bitrate_in_kbps) {
public void setVideoBitrateInKbps(Long video_bitrate_in_kbps) {
this.video_bitrate_in_kbps = video_bitrate_in_kbps;
}

Expand All @@ -323,11 +323,11 @@ public void setAudioCodec(AudioCodec audio_codec) {
this.audio_codec = audio_codec;
}

public Integer getAudioBitrateInKbps() {
public Long getAudioBitrateInKbps() {
return audio_bitrate_in_kbps;
}

public void setAudioBitrateInKbps(Integer audio_bitrate_in_kbps) {
public void setAudioBitrateInKbps(Long audio_bitrate_in_kbps) {
this.audio_bitrate_in_kbps = audio_bitrate_in_kbps;
}

Expand Down