1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

convenience bindings for {bytes} {megabytes} and {gigabytes}

This commit is contained in:
Reinhard Pointner 2015-12-25 12:39:58 +00:00
parent b13efb9c14
commit b4108ed2a5

View File

@ -788,6 +788,21 @@ public class MediaBindingBean {
return getMediaFile().getParentFile();
}
@Define("bytes")
public Long getFileSize() {
return getInferredMediaFile().length();
}
@Define("megabytes")
public String getFileSizeInMegaBytes() {
return String.format("%.0f", getFileSize() / Math.pow(1000, 2));
}
@Define("gigabytes")
public String getFileSizeInGigaBytes() {
return String.format("%.1f", getFileSize() / Math.pow(1000, 3));
}
@Define("home")
public File getUserHome() throws IOException {
return Settings.getRealUserHome();