Add missing retry count to the internal downloader.
Some checks failed
Docker Image CI / build (push) Has been cancelled
Some checks failed
Docker Image CI / build (push) Has been cancelled
This commit is contained in:
parent
cf4527b6c9
commit
9f4a34b20e
6 changed files with 18 additions and 10 deletions
|
|
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.0.46] - 2023-11-15
|
||||||
|
### Changed
|
||||||
|
- Fix in internal downloader.
|
||||||
|
|
||||||
## [2.0.45] - 2023-11-15
|
## [2.0.45] - 2023-11-15
|
||||||
### Changed
|
### Changed
|
||||||
- Optimizations to the internal downloader.
|
- Optimizations to the internal downloader.
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
<a class="navbar-item" routerLink="profile"> Profile </a>
|
<a class="navbar-item" routerLink="profile"> Profile </a>
|
||||||
<a class="navbar-item" (click)="logout()"> Logout </a>
|
<a class="navbar-item" (click)="logout()"> Logout </a>
|
||||||
<hr class="navbar-divider" />
|
<hr class="navbar-divider" />
|
||||||
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version 2.0.45</a>
|
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version 2.0.46</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rdt-client",
|
"name": "rdt-client",
|
||||||
"version": "2.0.45",
|
"version": "2.0.46",
|
||||||
"description": "This is a web interface to manage your torrents on Real-Debrid.",
|
"description": "This is a web interface to manage your torrents on Real-Debrid.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
<PackageReference Include="AllDebrid.NET" Version="1.0.12" />
|
<PackageReference Include="AllDebrid.NET" Version="1.0.12" />
|
||||||
<PackageReference Include="Aria2.NET" Version="1.0.5" />
|
<PackageReference Include="Aria2.NET" Version="1.0.5" />
|
||||||
<PackageReference Include="Downloader.NET" Version="1.0.6" />
|
<PackageReference Include="Downloader.NET" Version="1.0.8" />
|
||||||
<PackageReference Include="MonoTorrent" Version="2.0.7" />
|
<PackageReference Include="MonoTorrent" Version="2.0.7" />
|
||||||
<PackageReference Include="Premiumize.NET" Version="1.0.4" />
|
<PackageReference Include="Premiumize.NET" Version="1.0.4" />
|
||||||
<PackageReference Include="RD.NET" Version="2.1.4" />
|
<PackageReference Include="RD.NET" Version="2.1.4" />
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using DownloaderNET;
|
using System.Diagnostics;
|
||||||
|
using DownloaderNET;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
||||||
namespace RdtClient.Service.Services.Downloaders;
|
namespace RdtClient.Service.Services.Downloaders;
|
||||||
|
|
@ -33,7 +34,9 @@ public class InternalDownloader : IDownloader
|
||||||
|
|
||||||
_downloadService = new Downloader(_uri, _filePath, _downloadConfiguration);
|
_downloadService = new Downloader(_uri, _filePath, _downloadConfiguration);
|
||||||
|
|
||||||
_downloadService.OnProgress += args =>
|
_downloadService.OnLog += message => Debug.WriteLine(message.Message);
|
||||||
|
|
||||||
|
_downloadService.OnProgress += (chunks, _) =>
|
||||||
{
|
{
|
||||||
if (DownloadProgress == null)
|
if (DownloadProgress == null)
|
||||||
{
|
{
|
||||||
|
|
@ -43,9 +46,9 @@ public class InternalDownloader : IDownloader
|
||||||
DownloadProgress.Invoke(this,
|
DownloadProgress.Invoke(this,
|
||||||
new DownloadProgressEventArgs
|
new DownloadProgressEventArgs
|
||||||
{
|
{
|
||||||
Speed = (Int64) args.Sum(m => m.Speed),
|
Speed = (Int64)chunks.Where(m => m.IsActive).Sum(m => m.Speed),
|
||||||
BytesDone = args.Sum(m => m.DownloadBytes),
|
BytesDone = chunks.Sum(m => m.DownloadBytes),
|
||||||
BytesTotal = args.Sum(m => m.LengthBytes)
|
BytesTotal = chunks.Sum(m => m.LengthBytes)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -67,7 +70,7 @@ public class InternalDownloader : IDownloader
|
||||||
{
|
{
|
||||||
_logger.Debug($"Starting download of {_uri}, writing to path: {_filePath}");
|
_logger.Debug($"Starting download of {_uri}, writing to path: {_filePath}");
|
||||||
|
|
||||||
_downloadService.Download(_cancellationToken.Token);
|
Task.Run(async () => await _downloadService.Download(_cancellationToken.Token));
|
||||||
Task.Run(StartTimer);
|
Task.Run(StartTimer);
|
||||||
|
|
||||||
return Task.FromResult<String?>(null);
|
return Task.FromResult<String?>(null);
|
||||||
|
|
@ -120,6 +123,7 @@ public class InternalDownloader : IDownloader
|
||||||
_downloadConfiguration.Parallel = settingDownloadParallelCount;
|
_downloadConfiguration.Parallel = settingDownloadParallelCount;
|
||||||
_downloadConfiguration.MaximumBytesPerSecond = settingDownloadMaxSpeed;
|
_downloadConfiguration.MaximumBytesPerSecond = settingDownloadMaxSpeed;
|
||||||
_downloadConfiguration.Timeout = settingDownloadTimeout;
|
_downloadConfiguration.Timeout = settingDownloadTimeout;
|
||||||
|
_downloadConfiguration.RetryCount = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task StartTimer()
|
private async Task StartTimer()
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<UserSecretsId>94c24cba-f03f-4453-a671-3640b517c573</UserSecretsId>
|
<UserSecretsId>94c24cba-f03f-4453-a671-3640b517c573</UserSecretsId>
|
||||||
<Version>2.0.45</Version>
|
<Version>2.0.46</Version>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue