Skip to content

Commit

Permalink
Change delete behaviour for the QBittorrent Delete endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerfar committed Mar 6, 2024
1 parent eef7267 commit 99a29ca
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.63] - 2024-03-05
### Changed
- When Sonarr/Radarr requests a torrent to be deleted, and its files too, then delete those files instead of ingoring it.

## [2.0.62] - 2024-02-17
### Changed
- Fixed reporting a torrent as error when some downloads have failed but still need to be retried.
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.62</a>
<a href="https://github.com/rogerfar/rdt-client" target="_blank" class="navbar-item">Version 2.0.63</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.62",
"version": "2.0.63",
"description": "This is a web interface to manage your torrents on Real-Debrid.",
"main": "index.js",
"dependencies": {
Expand Down
15 changes: 11 additions & 4 deletions server/RdtClient.Service/Services/QBittorrent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,14 @@ public async Task<IList<TorrentInfo>> TorrentInfo()

public async Task TorrentsDelete(String hash, Boolean deleteFiles)
{
_logger.LogDebug($"Delete {hash}");
if (deleteFiles)
{
_logger.LogDebug($"Delete {hash}, with files");
}
else
{
_logger.LogDebug($"Delete {hash}, no files");
}

var torrent = await _torrents.GetByHash(hash);

Expand All @@ -411,17 +418,17 @@ public async Task TorrentsDelete(String hash, Boolean deleteFiles)
{
case TorrentFinishedAction.RemoveAllTorrents:
_logger.LogDebug("Removing torrents from debrid provider and RDT-Client, no files");
await _torrents.Delete(torrent.TorrentId, true, true, false);
await _torrents.Delete(torrent.TorrentId, true, true, deleteFiles);

break;
case TorrentFinishedAction.RemoveRealDebrid:
_logger.LogDebug("Removing torrents from debrid provider, no files");
await _torrents.Delete(torrent.TorrentId, false, true, false);
await _torrents.Delete(torrent.TorrentId, false, true, deleteFiles);

break;
case TorrentFinishedAction.RemoveClient:
_logger.LogDebug("Removing torrents from client, no files");
await _torrents.Delete(torrent.TorrentId, true, false, false);
await _torrents.Delete(torrent.TorrentId, true, false, deleteFiles);

break;
case TorrentFinishedAction.None:
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.62</Version>
<Version>2.0.63</Version>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
Expand Down

0 comments on commit 99a29ca

Please sign in to comment.