From 87448eea316ef274ff436ed269092c0e2ca89dc4 Mon Sep 17 00:00:00 2001 From: kaso17 Date: Wed, 9 Nov 2016 08:57:59 +0100 Subject: [PATCH] GetBytes(): add support for TB and default to bytes (#666) * Default to Bytes if there's no unit * GetBytes(): add support for TB --- src/Jackett/Models/ReleaseInfo.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Jackett/Models/ReleaseInfo.cs b/src/Jackett/Models/ReleaseInfo.cs index 15e33803d..133fde719 100644 --- a/src/Jackett/Models/ReleaseInfo.cs +++ b/src/Jackett/Models/ReleaseInfo.cs @@ -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)