From c6beedf67529ca4906ef77d9f139c7c1339294e6 Mon Sep 17 00:00:00 2001 From: YvesPa <166829028+YvesPa@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:07:34 +0200 Subject: [PATCH] Correct RealDebrid renaming sometimes --- client/src/app/torrent-table/torrent-table.component.html | 1 + client/src/app/torrent/torrent.component.html | 2 ++ server/RdtClient.Service/Helpers/DownloadHelper.cs | 7 +++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/src/app/torrent-table/torrent-table.component.html b/client/src/app/torrent-table/torrent-table.component.html index 42ed4d1..22cf5e8 100644 --- a/client/src/app/torrent-table/torrent-table.component.html +++ b/client/src/app/torrent-table/torrent-table.component.html @@ -191,6 +191,7 @@ +
diff --git a/client/src/app/torrent/torrent.component.html b/client/src/app/torrent/torrent.component.html
index 63da110..e6ed4fb 100644
--- a/client/src/app/torrent/torrent.component.html
+++ b/client/src/app/torrent/torrent.component.html
@@ -58,6 +58,7 @@
diff --git a/server/RdtClient.Service/Helpers/DownloadHelper.cs b/server/RdtClient.Service/Helpers/DownloadHelper.cs index bbb1775..665c936 100644 --- a/server/RdtClient.Service/Helpers/DownloadHelper.cs +++ b/server/RdtClient.Service/Helpers/DownloadHelper.cs @@ -1,5 +1,5 @@ -using System.Web; -using RdtClient.Data.Models.Data; +using RdtClient.Data.Models.Data; +using System.Web; namespace RdtClient.Service.Helpers; @@ -16,6 +16,9 @@ public static class DownloadHelper var directory = RemoveInvalidPathChars(torrent.RdName); + // RealDebrid sometimes change TorrentName when it's a single file torrent adding the extension of the single file + directory = Path.ChangeExtension(directory, null); + var uri = new Uri(fileUrl); var torrentPath = Path.Combine(downloadPath, directory);