Skip to content

Commit

Permalink
Download (v1/v2): Don't display file size if it is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Feb 15, 2024
1 parent a120983 commit 5a22007
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ private void initPropertiesFromMedia() {
if (rendition != null) {
filename = rendition.getFileName();
format = rendition.getMimeType();
size = FileUtils.byteCountToDisplaySize(rendition.getFileSize());
if (rendition.getFileSize() > 0) {
size = FileUtils.byteCountToDisplaySize(rendition.getFileSize());
}
extension = rendition.getFileExtension();
}

Expand Down
6 changes: 6 additions & 0 deletions changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
<body>

<release version="2.0.2-2.23.2" date="not released">
<action type="fix" dev="sseifert">
Download (v1/v2): Don't display file size if it is not available.
</action>
</release>

<release version="2.0.0-2.23.2" date="2024-01-26">
<action type="update" dev="sseifert"><![CDATA[
Version 2.0.0-2.23.2 requires Handler 2.x, See <a href=https://wcm-io.atlassian.net/wiki/x/AYBxsw">Migrate from wcm.io Handler 1.x to 2.x</a> for details.
Expand Down

0 comments on commit 5a22007

Please sign in to comment.