File size
-
- Posts: 10
- Joined: 20 Dec 2015, 15:54
File size
I am a person who catalogs multiple movies but tend to have the size on the end of the folders to help differentiate between them.
The Female Animal (1958)(VHSRip)(1.36)
The Female Animal (1958)(VHSRip)(856)
Is there a way to place the site as in the example above to the end of a folder through Filebot?
Was also wondering about how to get riptypes like VHSRip, LaserRip, URip, Unknownrip types added so that filebot can then use them.
The Female Animal (1958)(VHSRip)(1.36)
The Female Animal (1958)(VHSRip)(856)
Is there a way to place the site as in the example above to the end of a folder through Filebot?
Was also wondering about how to get riptypes like VHSRip, LaserRip, URip, Unknownrip types added so that filebot can then use them.
Re: File size
1.
There's many ways... this is one of them:
2.
If {tags} or {source} doesn't work, you can use the matchAll function on the filename. There's plenty of example in the forums.
There's many ways... this is one of them:
Code: Select all
{file.length()/1e6 as int}
If {tags} or {source} doesn't work, you can use the matchAll function on the filename. There's plenty of example in the forums.
-
- Posts: 10
- Joined: 20 Dec 2015, 15:54
Re: File size
1.rednoah wrote: 1.
There's many ways... this is one of them:2.Code: Select all
{file.length()/1e6 as int}
If {tags} or {source} doesn't work, you can use the matchAll function on the filename. There's plenty of example in the forums.
This helped out a great deal. The 1e6 was a bust since it gave bytes and that was not what I was looking for. I did end up using {"${file.length()/1024/1000}"} but as you can see it gives me to much information. Is there a way to remove everything after the period?
The Walk (2015)(HDRip)(1473.989458984375)/The.Walk.(2015).480p.HDRip.XviD.AC3.2.0-EVO
I tried using the round option I found in another thread about ratings but can't seem to get that to work out.
Re: File size
file.length() is the size in bytes, 1e6 is 1.000.000, and as int means as Integer, so no decimals.
-
- Posts: 10
- Joined: 20 Dec 2015, 15:54
Re: File size
Yes I understand that. I even mentioned it in my thanks for giving it to me. Just was wondering about trying to get that round option to work with this or think you can point to me an example of how regex works with FileBot.rednoah wrote:file.length() is the size in bytes, 1e6 is 1.000.000, and as int means as Integer, so no decimals.
Re: File size
1.
Round:
2.
Groovy Regex:
http://naleid.com/blog/2008/05/19/dont-fear-the-regexp
Round:
Code: Select all
{(file.length()/1e6).toFloat().round()}
Groovy Regex:
http://naleid.com/blog/2008/05/19/dont-fear-the-regexp
Re: File size
The latest revision adds convenience bindings for querying the filesize: {bytes}, {megabytes} and {gigabytes}
-
- Posts: 4
- Joined: 29 Apr 2020, 11:13
Re: File size
The bindings {bytes} {megabytes} and {gigabytes} are no longer INT on the latest Filebot version (tested with 4.9.4)
Re: File size
maybe you find what you need ?
e.g.
Code: Select all
{bytes.properties}
Code: Select all
{bytes.value}
{bytes.MB}
{bytes.k}
{bytes.g}
{bytes.GB}
{bytes.KB}
{bytes.m}
Re: File size
{bytes} is not longer a Number object, but you can get the long value (int won't work for large file size values) like so if you want to use it for mathematical operations:
What is your use case? Which mathematical operation do you need?
If you want a rounded decimal value for a specific file size unit, then this has gotten easier:
or
Note that {megabytes} and {gigabytes} were always String values (i.e. number formatted to 1 decimal and unit) from the beginning. The new FileSize type aims to fix these inconsistencies.
Code: Select all
bytes.toLong()
Code: Select all
(bytes as long)

If you want a rounded decimal value for a specific file size unit, then this has gotten easier:
Code: Select all
megabytes.round(1)
Code: Select all
bytes.MB.round(1)
