1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

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
This commit is contained in:
ta264 2020-05-12 21:43:08 +01:00
parent 95f66117e4
commit a19bcf9683
3 changed files with 4 additions and 4 deletions

View File

@ -80,9 +80,9 @@ public void should_add_indexer_flags()
[Test] [Test]
public void should_add_size() public void should_add_size()
{ {
var history = HistoryWithData("Size", 1500.ToString()); var history = HistoryWithData("Size", 9663676416.ToString());
var movieInfo = Subject.AugmentMovieInfo(MovieInfo, history); var movieInfo = Subject.AugmentMovieInfo(MovieInfo, history);
movieInfo.ExtraInfo["Size"].Should().BeEquivalentTo(1500); movieInfo.ExtraInfo["Size"].Should().BeEquivalentTo(9663676416);
} }
[Test] [Test]

View File

@ -120,7 +120,7 @@ public List<CustomFormat> ParseCustomFormat(MovieHistory history)
var parsed = _parsingService.ParseMovieInfo(history.SourceTitle, null); var parsed = _parsingService.ParseMovieInfo(history.SourceTitle, null);
Enum.TryParse(history.Data.GetValueOrDefault("indexerFlags"), true, out IndexerFlags flags); Enum.TryParse(history.Data.GetValueOrDefault("indexerFlags"), true, out IndexerFlags flags);
int.TryParse(history.Data.GetValueOrDefault("size"), out var size); long.TryParse(history.Data.GetValueOrDefault("size"), out var size);
var info = new ParsedMovieInfo var info = new ParsedMovieInfo
{ {

View File

@ -40,7 +40,7 @@ public ParsedMovieInfo AugmentMovieInfo(ParsedMovieInfo movieInfo, object helper
releaseInfo.IndexerId = indexerId; 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; releaseInfo.Size = size;
} }