From 09fe1bfc96e08580ea532576c50c263f34da4856 Mon Sep 17 00:00:00 2001 From: ta264 Date: Tue, 12 May 2020 21:30:35 +0100 Subject: [PATCH] Fixed: CustomFormat size specs in already grabbed check Sizes need to be parsed as a long not an int else anything with a size > 2GiB will fail to be parsed and be set with size 0 Fixes #4262 --- .../AugmentersTests/AugmentWithHistoryFixture.cs | 4 ++-- src/NzbDrone.Core/Parser/Augmenters/AugmentWithHistory.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/AugmentersTests/AugmentWithHistoryFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/AugmentersTests/AugmentWithHistoryFixture.cs index acb07dc91..0ec9e765a 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/AugmentersTests/AugmentWithHistoryFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/AugmentersTests/AugmentWithHistoryFixture.cs @@ -79,9 +79,9 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests.AugmentersTests [Test] public void should_add_size() { - var history = HistoryWithData("Size", 1500.ToString()); + var history = HistoryWithData("Size", 9663676416.ToString()); var movieInfo = Subject.AugmentMovieInfo(MovieInfo, history); - movieInfo.ExtraInfo["Size"].ShouldBeEquivalentTo(1500); + movieInfo.ExtraInfo["Size"].ShouldBeEquivalentTo(9663676416); } [Test] diff --git a/src/NzbDrone.Core/Parser/Augmenters/AugmentWithHistory.cs b/src/NzbDrone.Core/Parser/Augmenters/AugmentWithHistory.cs index 95f3cb88d..6ced3fa53 100644 --- a/src/NzbDrone.Core/Parser/Augmenters/AugmentWithHistory.cs +++ b/src/NzbDrone.Core/Parser/Augmenters/AugmentWithHistory.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Core.Parser.Augmenters releaseInfo.IndexerId = indexerId; } - if (int.TryParse(history.Data.GetValueOrDefault("size"), out var size)) + if (long.TryParse(history.Data.GetValueOrDefault("size"), out var size)) { releaseInfo.Size = size; }