Skip to content

Commit

Permalink
Fixed download path issue with Aria2c when a category is set.
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerfar committed May 3, 2024
1 parent 7382323 commit 06c034f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +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.76] - 2024-04-24
## [2.0.77] - 2024-05-03
### Changed
- Fixed Aria2c download path issue when a category is set.

## [2.0.76] - 2024-05-02
### Changed
- Fixed issues with the qBittorrent endpoint.
- Fixed issue that could crash the torrent runner.
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.76</a>
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version 2.0.77</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rdt-client",
"version": "2.0.76",
"version": "2.0.77",
"description": "This is a web interface to manage your torrents on Real-Debrid.",
"main": "index.js",
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions server/RdtClient.Service/Services/DownloadClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace RdtClient.Service.Services;

public class DownloadClient(Download download, Torrent torrent, String destinationPath)
public class DownloadClient(Download download, Torrent torrent, String destinationPath, String? category)
{
public IDownloader? Downloader;

Expand Down Expand Up @@ -47,7 +47,7 @@ public async Task<String> Start()
{
Data.Enums.DownloadClient.Internal => new InternalDownloader(download.Link, filePath),
Data.Enums.DownloadClient.Bezzad => new BezzadDownloader(download.Link, filePath),
Data.Enums.DownloadClient.Aria2c => new Aria2cDownloader(download.RemoteId, download.Link, filePath, downloadPath),
Data.Enums.DownloadClient.Aria2c => new Aria2cDownloader(download.RemoteId, download.Link, filePath, downloadPath, category),
Data.Enums.DownloadClient.Symlink => new SymlinkDownloader(download.Link, filePath, downloadPath),
_ => throw new($"Unknown download client {Type}")
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Aria2cDownloader : IDownloader

private String? _gid;

public Aria2cDownloader(String? gid, String uri, String filePath, String downloadPath)
public Aria2cDownloader(String? gid, String uri, String filePath, String downloadPath, String? category)
{
_logger = Log.ForContext<Aria2cDownloader>();
_logger.Debug($"Instantiated new Aria2c Downloader for URI {uri} to filePath {filePath} and downloadPath {downloadPath} and GID {gid}");
Expand All @@ -31,6 +31,11 @@ public Aria2cDownloader(String? gid, String uri, String filePath, String downloa
if (!String.IsNullOrWhiteSpace(Settings.Get.DownloadClient.Aria2cDownloadPath))
{
_remotePath = Path.Combine(Settings.Get.DownloadClient.Aria2cDownloadPath, downloadPath).Replace('\\', '/');

if (!String.IsNullOrWhiteSpace(category))
{
_remotePath = Path.Combine(_remotePath, category);
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion server/RdtClient.Service/Services/TorrentRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public async Task Tick()
Log($"Setting download path to {downloadPath}", download, torrent);

// Start the download process
var downloadClient = new DownloadClient(download, torrent, downloadPath);
var downloadClient = new DownloadClient(download, torrent, downloadPath, torrent.Category);

if (ActiveDownloadClients.TryAdd(download.DownloadId, downloadClient))
{
Expand Down
2 changes: 1 addition & 1 deletion server/RdtClient.Web/Controllers/SettingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public async Task<ActionResult> TestDownloadSpeed(CancellationToken cancellation
}
};

var downloadClient = new DownloadClient(download, download.Torrent, downloadPath);
var downloadClient = new DownloadClient(download, download.Torrent, downloadPath, null);

await downloadClient.Start();

Expand Down
2 changes: 1 addition & 1 deletion server/RdtClient.Web/RdtClient.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<UserSecretsId>94c24cba-f03f-4453-a671-3640b517c573</UserSecretsId>
<Version>2.0.76</Version>
<Version>2.0.77</Version>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
Expand Down

0 comments on commit 06c034f

Please sign in to comment.