Update On Sat Sep 6 20:35:54 CEST 2025

This commit is contained in:
github-action[bot]
2025-09-06 20:35:55 +02:00
parent 20396b5039
commit 93741b781f
164 changed files with 7460 additions and 3057 deletions

View File

@@ -26,8 +26,14 @@ internal static class BBDownDownloadUtil
private static async Task RangeDownloadToTmpAsync(int id, string url, string tmpName, long fromPosition, long? toPosition, Action<int, long, long> onProgress, bool failOnRangeNotSupported = false)
{
DateTimeOffset? lastTime = File.Exists(tmpName) ? new FileInfo(tmpName).LastWriteTimeUtc : null;
using var fileStream = new FileStream(tmpName, FileMode.Create);
using var fileStream = new FileStream(tmpName, FileMode.OpenOrCreate);
fileStream.Seek(0, SeekOrigin.End);
if (toPosition > 0 && fileStream.Position == toPosition - fromPosition + 1)
{
// 已下载完成 直接汇报进度并跳过下载
onProgress(id, fileStream.Position, fileStream.Position);
return;
}
var downloadedBytes = fromPosition + fileStream.Position;
using var httpRequestMessage = new HttpRequestMessage();

View File

@@ -503,8 +503,6 @@ internal partial class Program
{
if (downloadConfig.MultiThread && !url.Contains("-cmcc-"))
{
// 下载前先清理残片
foreach (var file in new DirectoryInfo(Path.GetDirectoryName(destPath)!).EnumerateFiles("*.?clip")) file.Delete();
await MultiThreadDownloadFileAsync(url, destPath, downloadConfig);
Log($"合并{(video ? "" : "")}分片...");
CombineMultipleFilesIntoSingleFile(GetFiles(Path.GetDirectoryName(destPath)!, $".{(video ? "v" : "a")}clip"), destPath);

View File

@@ -93,10 +93,9 @@ class ProgressBar : IDisposable, IProgress<double>
if (disposed) return;
int progressBlockCount = (int)(currentProgress * blockCount);
int percent = (int)(currentProgress * 100);
string text = string.Format(" [{0}{1}] {2,3}% {3}{4}",
new string('#', progressBlockCount), new string('-', blockCount - progressBlockCount),
percent,
double percent = currentProgress * 100;
string text = string.Format(" [{0}{1}] {2,3:0.00}% {3}{4}",
new string('#', progressBlockCount), new string('-', blockCount - progressBlockCount), percent,
animation[animationIndex++ % animation.Length],
speedString);
UpdateText(text);