Skip to content

Commit

Permalink
scanner: cater for zero byte length files when determining order for …
Browse files Browse the repository at this point in the history
…muyltiple matches exceeding size threshold
  • Loading branch information
stojy committed Apr 13, 2022
1 parent a101c19 commit 4e416f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ClrVpin/Scanner/ScannerUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private static List<FileDetail> Fix(ICollection<Game> games, string backupFolder
if (correctHitLength != null)
{
var sizeThreshold = _settings.Scanner.MultipleMatchExceedSizeThresholdPercentage / 100;
orderedByMostRecent = orderedByMostRecent.OrderByDescending(hit => hit.FileInfo?.Length / correctHitLength > sizeThreshold).ToList();
orderedByMostRecent = orderedByMostRecent.OrderByDescending(hit => correctHitLength != 0 && hit.FileInfo?.Length / correctHitLength > sizeThreshold).ToList();
}
FixOrderedHits(orderedByMostRecent.ToList(), gameFiles, game);
Expand Down

1 comment on commit 4e416f8

@stojy
Copy link
Owner Author

@stojy stojy commented on 4e416f8 Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#31 fix

Please sign in to comment.