From a356632d504a1240d419e894e8a56ef81c899f2b Mon Sep 17 00:00:00 2001 From: Roger Far Date: Sun, 28 Jul 2024 21:21:09 -0600 Subject: [PATCH 01/16] Upgrade to MonoTorrent 3. Catch infringed files from Real-Debrid and return a Failed. on qBittorrent. --- server/RdtClient.Data/RdtClient.Data.csproj | 2 +- server/RdtClient.Service/RdtClient.Service.csproj | 6 +++--- server/RdtClient.Service/Services/Torrents.cs | 6 +++--- .../Controllers/QBittorrentController.cs | 12 +++++++++++- .../RdtClient.Web/Controllers/TorrentsController.cs | 13 +++++++++---- server/RdtClient.Web/RdtClient.Web.csproj | 2 +- 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/server/RdtClient.Data/RdtClient.Data.csproj b/server/RdtClient.Data/RdtClient.Data.csproj index ca714f0..50558bb 100644 --- a/server/RdtClient.Data/RdtClient.Data.csproj +++ b/server/RdtClient.Data/RdtClient.Data.csproj @@ -16,7 +16,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/server/RdtClient.Service/RdtClient.Service.csproj b/server/RdtClient.Service/RdtClient.Service.csproj index c736d2e..f01e9d6 100644 --- a/server/RdtClient.Service/RdtClient.Service.csproj +++ b/server/RdtClient.Service/RdtClient.Service.csproj @@ -15,11 +15,11 @@ - + - - + + diff --git a/server/RdtClient.Service/Services/Torrents.cs b/server/RdtClient.Service/Services/Torrents.cs index cc39252..d1ff70d 100644 --- a/server/RdtClient.Service/Services/Torrents.cs +++ b/server/RdtClient.Service/Services/Torrents.cs @@ -115,7 +115,7 @@ public class Torrents( var id = await TorrentClient.AddMagnet(magnetLink); - var hash = magnet.InfoHash.ToHex(); + var hash = magnet.InfoHashes.V1OrV2.ToHex(); var newTorrent = await Add(id, hash, magnetLink, false, torrent); @@ -130,7 +130,7 @@ public class Torrents( Directory.CreateDirectory(Settings.Get.General.CopyAddedTorrents); } - var copyFileName = Path.Combine(Settings.Get.General.CopyAddedTorrents, $"{FileHelper.RemoveInvalidFileNameChars(magnet.Name)}.magnet"); + var copyFileName = Path.Combine(Settings.Get.General.CopyAddedTorrents, $"{FileHelper.RemoveInvalidFileNameChars(magnet.Name!)}.magnet"); if (File.Exists(copyFileName)) { @@ -166,7 +166,7 @@ public class Torrents( var id = await TorrentClient.AddFile(bytes); - var hash = monoTorrent.InfoHash.ToHex(); + var hash = monoTorrent.InfoHashes.V1OrV2.ToHex(); var newTorrent = await Add(id, hash, fileAsBase64, true, torrent); diff --git a/server/RdtClient.Web/Controllers/QBittorrentController.cs b/server/RdtClient.Web/Controllers/QBittorrentController.cs index d0c57cb..e80cfed 100644 --- a/server/RdtClient.Web/Controllers/QBittorrentController.cs +++ b/server/RdtClient.Web/Controllers/QBittorrentController.cs @@ -123,7 +123,7 @@ public class QBittorrentController(ILogger logger, QBitto [HttpPost] public ActionResult AppDefaultSavePath() { - var result = Settings.AppDefaultSavePath; + var result = Service.Services.Settings.AppDefaultSavePath; return Ok(result); } @@ -316,6 +316,7 @@ public class QBittorrentController(ILogger logger, QBitto foreach (var url in urls) { + try{ if (url.StartsWith("magnet")) { await qBittorrent.TorrentsAddMagnet(url.Trim(), request.Category, null); @@ -330,6 +331,15 @@ public class QBittorrentController(ILogger logger, QBitto { return BadRequest($"Invalid torrent link format {url}"); } + } + catch (RDNET.RealDebridException ex) + { + // Infringing file. + if (ex.ErrorCode == 35) + { + return Ok("Fails."); + } + } } return Ok(); diff --git a/server/RdtClient.Web/Controllers/TorrentsController.cs b/server/RdtClient.Web/Controllers/TorrentsController.cs index 634e9e2..69536b5 100644 --- a/server/RdtClient.Web/Controllers/TorrentsController.cs +++ b/server/RdtClient.Web/Controllers/TorrentsController.cs @@ -134,7 +134,7 @@ public class TorrentsController(ILogger logger, Torrents tor var torrent = await MonoTorrent.Torrent.LoadAsync(bytes); - var result = await torrents.GetAvailableFiles(torrent.InfoHash.ToHex()); + var result = await torrents.GetAvailableFiles(torrent.InfoHashes.V1OrV2.ToHex()); return Ok(result); } @@ -148,9 +148,14 @@ public class TorrentsController(ILogger logger, Torrents tor return BadRequest(); } + if (String.IsNullOrEmpty(request.MagnetLink)) + { + return BadRequest("MagnetLink cannot be null or empty"); + } + var magnet = MagnetLink.Parse(request.MagnetLink); - var result = await torrents.GetAvailableFiles(magnet.InfoHash.ToHex()); + var result = await torrents.GetAvailableFiles(magnet.InfoHashes.V1OrV2.ToHex()); return Ok(result); } @@ -226,7 +231,7 @@ public class TorrentsController(ILogger logger, Torrents tor { var magnet = MagnetLink.Parse(request.MagnetLink); - availableFiles = await torrents.GetAvailableFiles(magnet.InfoHash.ToHex()); + availableFiles = await torrents.GetAvailableFiles(magnet.InfoHashes.V1OrV2.ToHex()); } else if (file != null) { @@ -240,7 +245,7 @@ public class TorrentsController(ILogger logger, Torrents tor var torrent = await MonoTorrent.Torrent.LoadAsync(bytes); - availableFiles = await torrents.GetAvailableFiles(torrent.InfoHash.ToHex()); + availableFiles = await torrents.GetAvailableFiles(torrent.InfoHashes.V1OrV2.ToHex()); } else { diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index a7bb243..792a0da 100644 --- a/server/RdtClient.Web/RdtClient.Web.csproj +++ b/server/RdtClient.Web/RdtClient.Web.csproj @@ -38,7 +38,7 @@ - + From 7a8a0946d1f77bcf525330fdb00a16acd5be6393 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Sun, 28 Jul 2024 21:42:08 -0600 Subject: [PATCH 02/16] Force update torrent data when no filename is set. --- .../Services/TorrentClients/RealDebridTorrentClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs index 29c9958..2b09057 100644 --- a/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs @@ -287,7 +287,7 @@ public class RealDebridTorrentClient(ILogger logger, IH return torrent; } - if (torrentClientTorrent == null || torrentClientTorrent.Ended == null) + if (torrentClientTorrent == null || torrentClientTorrent.Ended == null || String.IsNullOrEmpty(torrentClientTorrent.Filename)) { torrentClientTorrent = await GetInfo(torrent.RdId) ?? throw new($"Resource not found"); } From 788fe654be51c7ee5f32be1f1dc550d989ad7f91 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Sun, 28 Jul 2024 21:43:17 -0600 Subject: [PATCH 03/16] Fixed deserialization issue in Real-Debrid provider. --- server/RdtClient.Service/RdtClient.Service.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/RdtClient.Service/RdtClient.Service.csproj b/server/RdtClient.Service/RdtClient.Service.csproj index f01e9d6..59f5e3c 100644 --- a/server/RdtClient.Service/RdtClient.Service.csproj +++ b/server/RdtClient.Service/RdtClient.Service.csproj @@ -18,7 +18,7 @@ - + From 02113a43ddf7af48a7fcde6523119e49f6ebdc9d Mon Sep 17 00:00:00 2001 From: Roger Far Date: Sun, 28 Jul 2024 21:44:46 -0600 Subject: [PATCH 04/16] Push to 81. --- CHANGELOG.md | 6 ++++++ client/src/app/navbar/navbar.component.html | 2 +- package.json | 2 +- server/RdtClient.Web/RdtClient.Web.csproj | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60fab41..06a9aa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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.81] - 2024-07-28 +### Changed +- Improved handling of infringed torrents from real debrid. +- Force update of torrent data from real-debrid when no filename is found in the local DB. +- Fixed real-debrid deserialization issue when checking for instant available files. + ## [2.0.80] - 2024-07-13 ### Changed - Add rate limiter to retry requests that are rate limited from Real-Debrid. diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index 3cb026b..6ec0751 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.80 + Version 2.0.81 diff --git a/package.json b/package.json index 204f20c..5011230 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdt-client", - "version": "2.0.80", + "version": "2.0.81", "description": "This is a web interface to manage your torrents on Real-Debrid.", "main": "index.js", "dependencies": { diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index 792a0da..016e14b 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.80 + 2.0.81 enable enable latest From c1e165c14c7ac0d3966789463f4d71616a9b47e4 Mon Sep 17 00:00:00 2001 From: DrFrankensteinUK Date: Thu, 1 Aug 2024 17:55:36 +0100 Subject: [PATCH 05/16] Update README.md Amended the docker section to point at the dedicated read me file as the information on the front page does not have the same detailed information or compose information. --- README.md | 48 ++---------------------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index c8aa2eb..a58efad 100644 --- a/README.md +++ b/README.md @@ -20,53 +20,9 @@ This is a web interface to manage your torrents on Real-Debrid, AllDebrid or Pre ## Docker Setup -You can run the docker container on Windows, Linux. To get started either use _Docker Run_ or _Docker Compose_. +Please see our separate Docker setup Read Me. -### Docker Run - -```console -docker run --pull=always - --volume /your/download/path/:/data/downloads \ - --volume /your/storage/path/:/data/db \ - --log-driver json-file \ - --log-opt max-size=10m \ - -p 6500:6500 \ - --name rdtclient \ - rogerfar/rdtclient:latest -``` - -Replace `/your/download/path/` with your local path to download files to. For Windows i.e. `C:/Downloads`. -Replace `/your/storage/path/` with your local path to store persistent database and log files in. For Windows i.e. `C:/Docker/rdt-client`. - -### Docker Compose - -You can use the provided docker compose to run: - -```yaml -version: '3.3' -services: - rdtclient: - container_name: rdtclient - volumes: - - 'D:/Downloads/:/data/downloads' - - 'D:/Docker/rdt-client/:/data/db' - image: rogerfar/rdtclient - restart: always - logging: - driver: json-file - options: - max-size: 10m - ports: - - '6500:6500' -``` - -And to run: - -```console -docker-compose up -d -``` - -Replace the paths in `volumes` as in the above step. +[Readme for Docker](README-DOCKER.md) ## Run as a Service From bb354b6a3628d13f12b2cdf103ba714a110a1852 Mon Sep 17 00:00:00 2001 From: GabbeHags <38500419+GabbeHags@users.noreply.github.com> Date: Sat, 3 Aug 2024 01:53:29 +0200 Subject: [PATCH 06/16] Update README.md with more steps for windows service --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c8aa2eb..8845891 100644 --- a/README.md +++ b/README.md @@ -71,13 +71,17 @@ Replace the paths in `volumes` as in the above step. ## Run as a Service Instead of running in Docker you can install it as a service in Windows or Linux. + ## Windows Service 1. Make sure you have the ASP.NET Core Runtime 8 installed: [https://dotnet.microsoft.com/download/dotnet/8.0](https://dotnet.microsoft.com/download/dotnet/8.0) -1. Get the latest zip file from the Releases page and extract it to your host. -1. Open the `appsettings.json` file and replace the `LogLevel` `Path` to a path on your host. -1. In `appsettings.json` replace the `Database` `Path` to a path on your host. -1. When using Windows paths, make sure to escape the slashes. For example: `D:\\RdtClient\\db\\rdtclient.db` +2. Get the latest zip file from the Releases page and extract it to your host. +3. Open the `appsettings.json` file and replace the `LogLevel` `Path` to a path on your host. +4. In `appsettings.json` replace the `Database` `Path` to a path on your host. +5. When using Windows paths, make sure to escape the slashes. For example: `D:\\RdtClient\\db\\rdtclient.db` +6. Do one of these: + * Run `RdtClient.Web.exe` to start the client. + * Run `service-install.bat` to install the client as a service. This will install `RdtClient.Web.exe` as a service which make the client start in the backgorund when the computer starts. (You probably want to do this if you are going to use this with Sonarr etc...) ## Linux Service From 6d4440de20d4548aadf911bd8fa73996b0066557 Mon Sep 17 00:00:00 2001 From: Mitchell Kelly Date: Sun, 4 Aug 2024 20:07:54 -0400 Subject: [PATCH 07/16] Fixed issue moving downloaded files in the base directory --- .../RdtClient.Service/Services/Downloaders/SymlinkDownloader.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/RdtClient.Service/Services/Downloaders/SymlinkDownloader.cs b/server/RdtClient.Service/Services/Downloaders/SymlinkDownloader.cs index 08d3e15..9739d0f 100644 --- a/server/RdtClient.Service/Services/Downloaders/SymlinkDownloader.cs +++ b/server/RdtClient.Service/Services/Downloaders/SymlinkDownloader.cs @@ -73,6 +73,8 @@ public class SymlinkDownloader(String uri, String destinationPath, String path) potentialFilePaths.Add(fileName); potentialFilePaths.Add(fileNameWithoutExtension); + // add an empty path so we can check for the new file in the base directory + potentialFilePaths.Add(""); potentialFilePaths = potentialFilePaths.Distinct().ToList(); From f65e3fb405b7b9c129495ca53ec06c701022eb8d Mon Sep 17 00:00:00 2001 From: Roger Far Date: Mon, 2 Sep 2024 19:16:01 -0600 Subject: [PATCH 08/16] Upgrade packages and build with Alpine 3.20. --- CHANGELOG.md | 4 ++++ Dockerfile | 2 +- server/RdtClient.Data/RdtClient.Data.csproj | 10 +++++----- server/RdtClient.Service/RdtClient.Service.csproj | 8 ++++---- server/RdtClient.Web/RdtClient.Web.csproj | 12 ++++++------ 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06a9aa8..7c87c57 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.82] - 2024-09-02 +### Changed +- Update packages and docker alpine version. + ## [2.0.81] - 2024-07-28 ### Changed - Improved handling of infringed torrents from real debrid. diff --git a/Dockerfile b/Dockerfile index 11cd3cd..c47571a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ RUN \ dotnet restore --no-cache RdtClient.sln && dotnet publish --no-restore -c Release -o out ; # Stage 3 - Build runtime image -FROM ghcr.io/linuxserver/baseimage-alpine:3.18 +FROM ghcr.io/linuxserver/baseimage-alpine:3.20 ARG TARGETPLATFORM ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} ARG BUILDPLATFORM diff --git a/server/RdtClient.Data/RdtClient.Data.csproj b/server/RdtClient.Data/RdtClient.Data.csproj index 50558bb..81e9430 100644 --- a/server/RdtClient.Data/RdtClient.Data.csproj +++ b/server/RdtClient.Data/RdtClient.Data.csproj @@ -8,11 +8,11 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/server/RdtClient.Service/RdtClient.Service.csproj b/server/RdtClient.Service/RdtClient.Service.csproj index 59f5e3c..86ce058 100644 --- a/server/RdtClient.Service/RdtClient.Service.csproj +++ b/server/RdtClient.Service/RdtClient.Service.csproj @@ -13,15 +13,15 @@ - - - + + + - + diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index 016e14b..b03af72 100644 --- a/server/RdtClient.Web/RdtClient.Web.csproj +++ b/server/RdtClient.Web/RdtClient.Web.csproj @@ -29,17 +29,17 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + From cc52f5f7f58e6bb1825d0113b267aecc64056033 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Mon, 2 Sep 2024 21:07:46 -0600 Subject: [PATCH 09/16] Fixed download progress reporting to the qBittorrent API. --- server/RdtClient.Service/Services/QBittorrent.cs | 12 ++++++------ .../Controllers/QBittorrentController.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/server/RdtClient.Service/Services/QBittorrent.cs b/server/RdtClient.Service/Services/QBittorrent.cs index ff3f809..e20f7c1 100644 --- a/server/RdtClient.Service/Services/QBittorrent.cs +++ b/server/RdtClient.Service/Services/QBittorrent.cs @@ -194,7 +194,7 @@ public class QBittorrent(ILogger logger, Settings settings, Authent var prio = 0; - Decimal downloadProgress = 0; + Double downloadProgress = 0; foreach (var torrent in allTorrents) { @@ -214,12 +214,12 @@ public class QBittorrent(ILogger logger, Settings settings, Authent Int64 bytesDone = 0; Int64 bytesTotal = 0; Int64 speed = 0; - Int64 rdProgress = 0; + Double rdProgress = 0; try { - rdProgress = (Int64) ((torrent.RdProgress ?? 0) / 100.0m); + rdProgress = (torrent.RdProgress ?? 0.0) / 100.0; bytesTotal = torrent.RdSize ?? 1; - bytesDone = bytesTotal * rdProgress; + bytesDone = (Int64) (bytesTotal * rdProgress); speed = torrent.RdSpeed ?? 0; } catch (Exception ex) @@ -237,10 +237,10 @@ public class QBittorrent(ILogger logger, Settings settings, Authent bytesDone = torrent.Downloads.Sum(m => m.BytesDone); bytesTotal = torrent.Downloads.Sum(m => m.BytesTotal); speed = (Int32) torrent.Downloads.Average(m => m.Speed); - downloadProgress = bytesTotal > 0 ? (Decimal) bytesDone / bytesTotal : 0; + downloadProgress = bytesTotal > 0 ? (Double) bytesDone / bytesTotal : 0; } - var progress = (Int64) ((rdProgress + downloadProgress) / 2m); + var progress = (rdProgress + downloadProgress) / 2.0; var result = new TorrentInfo { diff --git a/server/RdtClient.Web/Controllers/QBittorrentController.cs b/server/RdtClient.Web/Controllers/QBittorrentController.cs index e80cfed..4fdfd77 100644 --- a/server/RdtClient.Web/Controllers/QBittorrentController.cs +++ b/server/RdtClient.Web/Controllers/QBittorrentController.cs @@ -123,7 +123,7 @@ public class QBittorrentController(ILogger logger, QBitto [HttpPost] public ActionResult AppDefaultSavePath() { - var result = Service.Services.Settings.AppDefaultSavePath; + var result = Settings.AppDefaultSavePath; return Ok(result); } From 078bbe4bfba532c7a49b55ba27fffef81140f630 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Mon, 2 Sep 2024 21:08:00 -0600 Subject: [PATCH 10/16] Prevent creation of download folders when using the symlink downloader. --- server/RdtClient.Service/Helpers/DownloadHelper.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/RdtClient.Service/Helpers/DownloadHelper.cs b/server/RdtClient.Service/Helpers/DownloadHelper.cs index 0c9a1c4..94d1583 100644 --- a/server/RdtClient.Service/Helpers/DownloadHelper.cs +++ b/server/RdtClient.Service/Helpers/DownloadHelper.cs @@ -1,4 +1,5 @@ using System.Web; +using RdtClient.Data.Enums; using RdtClient.Data.Models.Data; namespace RdtClient.Service.Helpers; @@ -41,7 +42,7 @@ public static class DownloadHelper } } - if (!Directory.Exists(torrentPath)) + if (torrent.DownloadClient != DownloadClient.Symlink && !Directory.Exists(torrentPath)) { Directory.CreateDirectory(torrentPath); } @@ -85,7 +86,7 @@ public static class DownloadHelper } } - if (!Directory.Exists(torrentPath)) + if (torrent.DownloadClient != DownloadClient.Symlink && !Directory.Exists(torrentPath)) { Directory.CreateDirectory(torrentPath); } From af87a1e6e652d5afb828663e1d10f04ea93b4f76 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Mon, 2 Sep 2024 21:12:30 -0600 Subject: [PATCH 11/16] no message --- CHANGELOG.md | 5 +++++ client/src/app/navbar/navbar.component.html | 2 +- package.json | 2 +- server/RdtClient.Web/Properties/launchSettings.json | 3 ++- server/RdtClient.Web/RdtClient.Web.csproj | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c87c57..b8fd2df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.83] - 2024-09-02 +### Changed +- Fixed progress reporting to the qBittorrent API endpoint. +- Prevent the creation of download folders when using symlink. + ## [2.0.82] - 2024-09-02 ### Changed - Update packages and docker alpine version. diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index 6ec0751..a900b61 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.81 + Version 2.0.83 diff --git a/package.json b/package.json index 5011230..035fb91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdt-client", - "version": "2.0.81", + "version": "2.0.83", "description": "This is a web interface to manage your torrents on Real-Debrid.", "main": "index.js", "dependencies": { diff --git a/server/RdtClient.Web/Properties/launchSettings.json b/server/RdtClient.Web/Properties/launchSettings.json index 575e31e..ab3e967 100644 --- a/server/RdtClient.Web/Properties/launchSettings.json +++ b/server/RdtClient.Web/Properties/launchSettings.json @@ -11,7 +11,8 @@ "RdtClient.Web": { "commandName": "Project", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Development", + "BASE_PATH": "test" }, "applicationUrl": "http://localhost:6500" }, diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index b03af72..f2c87a4 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.81 + 2.0.83 enable enable latest From b1f93d1892d2d56d9850c1865442e16181cb609a Mon Sep 17 00:00:00 2001 From: Roger Far Date: Mon, 2 Sep 2024 21:18:26 -0600 Subject: [PATCH 12/16] Replace docker libssl1.1 with libssl3 --- CHANGELOG.md | 4 ++++ Dockerfile | 2 +- client/src/app/navbar/navbar.component.html | 2 +- package.json | 2 +- server/RdtClient.Web/RdtClient.Web.csproj | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8fd2df..ae9c266 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.84] - 2024-09-02 +### Changed +- Replace docker libssl1.1 with libssl3 + ## [2.0.83] - 2024-09-02 ### Changed - Fixed progress reporting to the qBittorrent API endpoint. diff --git a/Dockerfile b/Dockerfile index c47571a..9bc6a22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,7 +60,7 @@ RUN \ echo "**** Updating package information ****" && \ apk update && \ echo "**** Install pre-reqs ****" && \ - apk add bash icu-libs krb5-libs libgcc libintl libssl1.1 libstdc++ zlib && \ + apk add bash icu-libs krb5-libs libgcc libintl libssl3 libstdc++ zlib && \ echo "**** Installing dotnet ****" && \ mkdir -p /usr/share/dotnet diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index a900b61..f848038 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.83 + Version 2.0.84 diff --git a/package.json b/package.json index 035fb91..c68ac9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdt-client", - "version": "2.0.83", + "version": "2.0.84", "description": "This is a web interface to manage your torrents on Real-Debrid.", "main": "index.js", "dependencies": { diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index f2c87a4..9c73838 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.83 + 2.0.84 enable enable latest From b66b864caeaaea6f6c50d8b70bd295e89d690040 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Tue, 3 Sep 2024 19:14:36 -0600 Subject: [PATCH 13/16] Revert "Prevent creation of download folders when using the symlink downloader." This reverts commit 078bbe4bfba532c7a49b55ba27fffef81140f630. --- server/RdtClient.Service/Helpers/DownloadHelper.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/RdtClient.Service/Helpers/DownloadHelper.cs b/server/RdtClient.Service/Helpers/DownloadHelper.cs index 94d1583..0c9a1c4 100644 --- a/server/RdtClient.Service/Helpers/DownloadHelper.cs +++ b/server/RdtClient.Service/Helpers/DownloadHelper.cs @@ -1,5 +1,4 @@ using System.Web; -using RdtClient.Data.Enums; using RdtClient.Data.Models.Data; namespace RdtClient.Service.Helpers; @@ -42,7 +41,7 @@ public static class DownloadHelper } } - if (torrent.DownloadClient != DownloadClient.Symlink && !Directory.Exists(torrentPath)) + if (!Directory.Exists(torrentPath)) { Directory.CreateDirectory(torrentPath); } @@ -86,7 +85,7 @@ public static class DownloadHelper } } - if (torrent.DownloadClient != DownloadClient.Symlink && !Directory.Exists(torrentPath)) + if (!Directory.Exists(torrentPath)) { Directory.CreateDirectory(torrentPath); } From 8266e53435dbfd16464cf12aece689519384702e Mon Sep 17 00:00:00 2001 From: Roger Far Date: Tue, 3 Sep 2024 19:15:31 -0600 Subject: [PATCH 14/16] no message --- CHANGELOG.md | 4 ++++ client/src/app/navbar/navbar.component.html | 2 +- package.json | 2 +- server/RdtClient.Web/RdtClient.Web.csproj | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae9c266..2588ffd 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.85] - 2024-09-03 +### Changed +- Reverted: Prevent the creation of download folders when using symlink. + ## [2.0.84] - 2024-09-02 ### Changed - Replace docker libssl1.1 with libssl3 diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index f848038..9129f8d 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.84 + Version 2.0.85 diff --git a/package.json b/package.json index c68ac9d..54568ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdt-client", - "version": "2.0.84", + "version": "2.0.85", "description": "This is a web interface to manage your torrents on Real-Debrid.", "main": "index.js", "dependencies": { diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index 9c73838..1aa0486 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.84 + 2.0.85 enable enable latest From 96bc3308f6c09763fe323cdf7366b654cda2259b Mon Sep 17 00:00:00 2001 From: Roger Far Date: Tue, 3 Sep 2024 19:22:53 -0600 Subject: [PATCH 15/16] Base path fix. --- server/RdtClient.Web/Program.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/server/RdtClient.Web/Program.cs b/server/RdtClient.Web/Program.cs index cceb762..e65ad0c 100644 --- a/server/RdtClient.Web/Program.cs +++ b/server/RdtClient.Web/Program.cs @@ -168,6 +168,7 @@ try if (basePath != null) { app.UseMiddleware(basePath); + app.UsePathBase($"/{basePath.TrimStart('/').TrimEnd('/')}/"); } app.UseMiddleware(); From 35f959ee26940c4f8d52f19ef57eeaf8955d80e6 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Tue, 3 Sep 2024 19:59:21 -0600 Subject: [PATCH 16/16] Fixed the DownloadHelper creating ghost folders. Also don't delete the file when starting a symlink download. --- CHANGELOG.md | 5 +++++ client/src/app/navbar/navbar.component.html | 2 +- package.json | 2 +- server/RdtClient.Service/Helpers/DownloadHelper.cs | 5 ----- server/RdtClient.Service/Services/DownloadClient.cs | 7 +++++-- server/RdtClient.Web/RdtClient.Web.csproj | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2588ffd..88b2cc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.86] - 2024-09-03 +### Changed +- Add potential fix for BASE_PATH. +- Fixed creation of empty folders. + ## [2.0.85] - 2024-09-03 ### Changed - Reverted: Prevent the creation of download folders when using symlink. diff --git a/client/src/app/navbar/navbar.component.html b/client/src/app/navbar/navbar.component.html index 9129f8d..8395feb 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.85 + Version 2.0.86 diff --git a/package.json b/package.json index 54568ef..4ea720f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdt-client", - "version": "2.0.85", + "version": "2.0.86", "description": "This is a web interface to manage your torrents on Real-Debrid.", "main": "index.js", "dependencies": { diff --git a/server/RdtClient.Service/Helpers/DownloadHelper.cs b/server/RdtClient.Service/Helpers/DownloadHelper.cs index 0c9a1c4..bbb1775 100644 --- a/server/RdtClient.Service/Helpers/DownloadHelper.cs +++ b/server/RdtClient.Service/Helpers/DownloadHelper.cs @@ -85,11 +85,6 @@ public static class DownloadHelper } } - if (!Directory.Exists(torrentPath)) - { - Directory.CreateDirectory(torrentPath); - } - var filePath = Path.Combine(torrentPath, fileName); return filePath; diff --git a/server/RdtClient.Service/Services/DownloadClient.cs b/server/RdtClient.Service/Services/DownloadClient.cs index b8a268d..3ab400b 100644 --- a/server/RdtClient.Service/Services/DownloadClient.cs +++ b/server/RdtClient.Service/Services/DownloadClient.cs @@ -39,10 +39,13 @@ public class DownloadClient(Download download, Torrent torrent, String destinati throw new("Invalid download path"); } - await FileHelper.Delete(filePath); - Type = torrent.DownloadClient; + if (Type != Data.Enums.DownloadClient.Symlink) + { + await FileHelper.Delete(filePath); + } + Downloader = Type switch { Data.Enums.DownloadClient.Internal => new InternalDownloader(download.Link, filePath), diff --git a/server/RdtClient.Web/RdtClient.Web.csproj b/server/RdtClient.Web/RdtClient.Web.csproj index 1aa0486..9de70e8 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.85 + 2.0.86 enable enable latest