mirror of https://github.com/Jackett/Jackett
GetBytes(): add support for TB and default to bytes (#666)
* Default to Bytes if there's no unit * GetBytes(): add support for TB
This commit is contained in:
parent
5e2fa1408e
commit
87448eea31
|
@ -81,7 +81,14 @@ namespace Jackett.Models
|
|||
return BytesFromMB(value);
|
||||
if (unit.Contains("gb"))
|
||||
return BytesFromGB(value);
|
||||
return 0;
|
||||
if (unit.Contains("tb"))
|
||||
return BytesFromTB(value);
|
||||
return (long)value;
|
||||
}
|
||||
|
||||
public static long BytesFromTB(float tb)
|
||||
{
|
||||
return BytesFromGB(tb * 1024f);
|
||||
}
|
||||
|
||||
public static long BytesFromGB(float gb)
|
||||
|
|
Loading…
Reference in New Issue