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:
kaso17 2016-11-09 08:57:59 +01:00 committed by GitHub
parent 5e2fa1408e
commit 87448eea31
1 changed files with 8 additions and 1 deletions

View File

@ -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)