Skip to content

Commit

Permalink
#331: Change step templete get in step data
Browse files Browse the repository at this point in the history
  • Loading branch information
malsolec committed Aug 12, 2018
1 parent a764894 commit 2b74934
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void setStepName(String stepName) {

@Bindable
public String getPictureName() {
return getAssetFileName(stepTemplate.getPicture());
return getAssetFileName(stepTemplate.getPictureId());
}

public void setPictureName(String pictureName) {
Expand All @@ -45,7 +45,7 @@ public void setPictureName(String pictureName) {

@Bindable
public String getSoundName() {
return getAssetFileName(stepTemplate.getSound());
return getAssetFileName(stepTemplate.getSoundId());
}

public void setSoundName(String soundName) {
Expand Down Expand Up @@ -79,16 +79,17 @@ private Asset getAsset(String fileName, Asset asset) {
if (asset == null) {
asset = new Asset();
}

asset.setFilename(fileName);

return asset;
}

private String getAssetFileName(Asset asset) {
if (asset == null) {
private String getAssetFileName(Long assetId) {
if (assetId == null) {
return EMPTY_VALUE;
}

return asset.getFilename().replace(REGEX_TRIM_NAME, "");
return stepTemplate.getSound().getFilename().replace(REGEX_TRIM_NAME, "");
}
}

0 comments on commit 2b74934

Please sign in to comment.