Fixed issue where a lot of downloads could be tried in 1 go, causing a bit of a DOS to real-debrid, fixed the status of the torrent as error incorrectly when some downloads are errored out.
Some checks failed
Docker Image CI / build (push) Has been cancelled

This commit is contained in:
Roger Far 2024-02-17 15:34:49 -07:00
parent f96ef294a7
commit 4fb0a8d726
8 changed files with 20 additions and 28 deletions

View file

@ -4,6 +4,11 @@ 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.0.62] - 2024-02-17
### Changed
- Fixed reporting a torrent as error when some downloads have failed but still need to be retried.
- Fixed issue where downloads could get started over and over.
## [2.0.61] - 2024-01-21
### Added
- Added setting to include or exclude files based on a given regex.

View file

@ -55,7 +55,7 @@
<a class="navbar-item" routerLink="profile"> Profile </a>
<a class="navbar-item" (click)="logout()"> Logout </a>
<hr class="navbar-divider" />
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version 2.0.61</a>
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version 2.0.62</a>
</div>
</div>
</div>

View file

@ -14,12 +14,6 @@ export class TorrentStatusPipe implements PipeTransform {
}
if (torrent.downloads.length > 0) {
const errors = torrent.downloads.where((m) => m.error != null);
if (errors.length > 0) {
return 'Error';
}
const allFinished = torrent.downloads.all((m) => m.completed != null);
if (allFinished) {
@ -62,7 +56,7 @@ export class TorrentStatusPipe implements PipeTransform {
}
return `Extracting file ${unpacking.length + unpacked.length}/${torrent.downloads.length} (${progress.toFixed(
2
2,
)}%)`;
}

View file

@ -1,6 +1,6 @@
{
"name": "rdt-client",
"version": "2.0.61",
"version": "2.0.62",
"description": "This is a web interface to manage your torrents on Real-Debrid.",
"main": "index.js",
"dependencies": {

View file

@ -18,7 +18,12 @@ public static class Logger
var done = (Int32)((Double)download.BytesDone / download.BytesTotal * 100);
return $"for download {fileName}. Completed: {done}%, avg speed: {download.Speed}bytes/s ({download.DownloadId})";
if (done < 0)
{
done = 0;
}
return $"for download {fileName}. Completed: {done}%, avg speed: {download.Speed}bytes/s ({download.DownloadId}) remoteID: {download.RemoteId}";
}
public static String ToLog(this Torrent torrent)

View file

@ -290,27 +290,13 @@ public class QBittorrent
Upspeed = speed
};
if (torrent.Retry != null)
{
result.State = "downloading";
}
else if (!String.IsNullOrWhiteSpace(torrent.Error))
if (!String.IsNullOrWhiteSpace(torrent.Error))
{
result.State = "error";
}
else if (torrent.Completed.HasValue)
{
var allDownloadsComplete = torrent.Downloads.All(m => m.Completed.HasValue);
var hasDownloadsWithErrors = torrent.Downloads.Any(m => m.Error != null);
if (torrent.Downloads.Count == 0 || hasDownloadsWithErrors || torrent.RdStatus == TorrentStatus.Error)
{
result.State = "error";
}
else if (allDownloadsComplete)
{
result.State = "pausedUP";
}
result.State = "pausedUP";
}
results.Add(result);

View file

@ -335,6 +335,8 @@ public class TorrentRunner
.OrderBy(m => m.DownloadQueued)
.ToList();
Log($"Currently {queuedDownloads.Count} queued downloads and {ActiveDownloadClients.Count} total active downloads", torrent);
foreach (var download in queuedDownloads)
{
Log($"Processing to download", download, torrent);
@ -388,7 +390,7 @@ public class TorrentRunner
var remoteId = await downloadClient.Start();
if (String.IsNullOrWhiteSpace(remoteId) || download.RemoteId == remoteId)
if (String.IsNullOrWhiteSpace(remoteId))
{
Log($"No ID received", download, torrent);
continue;

View file

@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<UserSecretsId>94c24cba-f03f-4453-a671-3640b517c573</UserSecretsId>
<Version>2.0.61</Version>
<Version>2.0.62</Version>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>