diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 260c1f60..df93d798 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -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();