Skip to content

Commit

Permalink
Calculate SHA-1 if spec version is null
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Aug 13, 2024
1 parent 7d6d90e commit 7c5174d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Core/Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public static class Platform
public static readonly bool IsUnix = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);

/// <summary>
/// Are we on a flavour of Windows? This is implemented internally by checking
/// if we're not on Unix or Mac.
/// Are we on a flavour of Windows?
/// </summary>
/// <value><c>true</c> if is windows; otherwise, <c>false</c>.</value>
#if NET6_0_OR_GREATER
Expand Down
2 changes: 1 addition & 1 deletion Netkan/Transformers/DownloadAttributeTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public IEnumerable<Metadata> Transform(Metadata metadata, TransformOptions opts)

var download_hashJson = (JObject)json["download_hash"];
// Older clients will complain if download_hash is set without sha1
if (metadata.SpecVersion <= v1p34)
if (metadata.SpecVersion == null || metadata.SpecVersion <= v1p34)
{
Log.Debug("Calculating download SHA1...");
download_hashJson.SafeAdd("sha1", _fileService.GetFileHashSha1(file));
Expand Down

0 comments on commit 7c5174d

Please sign in to comment.