-
Notifications
You must be signed in to change notification settings - Fork 26
Refactor: Downloader #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor: Downloader #130
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Donwnloader中
public Downloader Run()
{
Task.Run(Manager);
return this;
}
部分可以改为直接返回Task<Downloader>
,这样就可以使用await
或ContinueWith
,减少使用Wait的阻塞等待
其余部分的Req-Reivew与Comment相同
public static readonly MojangJavaVersion A = new("java-runtime-alpha"); | ||
public static readonly MojangJavaVersion Β = new("java-runtime-beta"); | ||
public static readonly MojangJavaVersion Δ = new("java-runtime-delta"); | ||
public static readonly MojangJavaVersion Γ = new("java-runtime-gamma"); | ||
public static readonly MojangJavaVersion Γs = new("java-runtime-gamma-snapshot"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改为英文Alpla,Beta,Gamma,Delta
禁止使用非ASCII字符
} | ||
catch (IOException e) | ||
{ | ||
// TODO: handle this storage space is run out exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
完成TODO的内容(其余TODO的req-review相同)
// ERROR: TODO: i cant understand this codes... | ||
// await using var lzmaFs = await DownloadReceipt.FastDownloadAsStreamAsync(urlLzma, | ||
// localFilePath + ".lzma", sha1Lzma, cancellationToken); | ||
// await using var fs = lzmaFs.DecompressLzma(localFilePath); | ||
// if (fs is null) | ||
// { | ||
// Console.WriteLine("outStream 为空"); | ||
// return; | ||
// } | ||
// | ||
// if (!await new FileIntegrity { Hash = sha1Raw }.VerifyAsync(fs, cancellationToken)) | ||
// { | ||
// Console.WriteLine("解压后的文件SHA-1与源提供的不匹配"); | ||
// return; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对此处未更改部分更改为新的downloader
// TODO: i cant understand this codes... | ||
|
||
//ERROR: tasks.Add(DownloadReceipt.FastDownloadAsync(urlRaw, localFilePath, sha1Raw, cancellationToken)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对此处未更改部分改为新的downloader
<ItemGroup> | ||
<Compile Remove="Download\Minercraft\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Remove="Download\Minercraft\**" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="Download\Minercraft\**" /> | ||
</ItemGroup> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移除此处的更改,未找到对应的文件和文件夹
Closed as no planned. |
Closes #124