diff --git a/CHANGELOG.md b/CHANGELOG.md
index de63e50..9ed322a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [2.0.56] - 2024-01-07
+### Changed
+- Add retry mechanism for the downloaders.
+
## [2.0.55] - 2024-01-07
### Changed
- Tweaked the internal downloader to prevent memory issues.
diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html
index 8605d3c..f37c374 100644
--- a/client/src/app/navbar/navbar.component.html
+++ b/client/src/app/navbar/navbar.component.html
@@ -55,7 +55,7 @@
Profile
Logout
- Version 2.0.55
+ Version 2.0.56
diff --git a/package.json b/package.json
index cbde579..3843c95 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "rdt-client",
- "version": "2.0.55",
+ "version": "2.0.56",
"description": "This is a web interface to manage your torrents on Real-Debrid.",
"main": "index.js",
"dependencies": {
diff --git a/server/RdtClient.Service/Services/TorrentRunner.cs b/server/RdtClient.Service/Services/TorrentRunner.cs
index bdddf1c..df2b4fb 100644
--- a/server/RdtClient.Service/Services/TorrentRunner.cs
+++ b/server/RdtClient.Service/Services/TorrentRunner.cs
@@ -347,11 +347,6 @@ public class TorrentRunner
continue;
}
- Log($"Marking download as started", download, torrent);
-
- download.DownloadStarted = DateTime.UtcNow;
- await _downloads.UpdateDownloadStarted(download.DownloadId, download.DownloadStarted);
-
var downloadPath = settingDownloadPath;
if (!String.IsNullOrWhiteSpace(torrent.Category))
@@ -364,23 +359,27 @@ public class TorrentRunner
// Start the download process
var downloadClient = new DownloadClient(download, torrent, downloadPath);
- if (ActiveDownloadClients.TryAdd(download.DownloadId, downloadClient))
+ Log($"Starting download", download, torrent);
+
+ var remoteId = await downloadClient.Start();
+
+ if (String.IsNullOrWhiteSpace(remoteId) || download.RemoteId == remoteId)
{
- Log($"Starting download", download, torrent);
-
- var remoteId = await downloadClient.Start();
-
- if (!String.IsNullOrWhiteSpace(remoteId) && download.RemoteId != remoteId)
- {
- Log($"Received ID {remoteId}", download, torrent);
-
- await _downloads.UpdateRemoteId(download.DownloadId, remoteId);
- }
- else
- {
- Log($"No ID received", download, torrent);
- }
+ Log($"No ID received", download, torrent);
+ continue;
}
+
+ Log($"Received ID {remoteId}", download, torrent);
+
+ download.RemoteId = remoteId;
+ await _downloads.UpdateRemoteId(download.DownloadId, remoteId);
+
+ Log($"Marking download as started", download, torrent);
+
+ download.DownloadStarted = DateTime.UtcNow;
+ await _downloads.UpdateDownloadStarted(download.DownloadId, download.DownloadStarted);
+
+ ActiveDownloadClients.TryAdd(download.DownloadId, downloadClient);
}
// Check if there are any unpacks that are queued and can be started.
diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj
index 492bd0f..51002a7 100644
--- a/server/RdtClient.Web/RdtClient.Web.csproj
+++ b/server/RdtClient.Web/RdtClient.Web.csproj
@@ -4,7 +4,7 @@
net8.0
Exe
94c24cba-f03f-4453-a671-3640b517c573
- 2.0.55
+ 2.0.56
enable
enable
latest