diff --git a/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs index 3c7c789..dd3f424 100644 --- a/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/AllDebridTorrentClient.cs @@ -263,16 +263,16 @@ public class AllDebridTorrentClient(ILogger logger, IHtt return links.Select(m => m.LinkUrl.ToString()).ToList(); } - public Task GetFileName(String downloadUrl) + public Task GetFileName(String downloadUrl) { if (String.IsNullOrWhiteSpace(downloadUrl)) { - return Task.FromResult(null); + return Task.FromResult(""); } var uri = new Uri(downloadUrl); - return Task.FromResult(HttpUtility.UrlDecode(uri.Segments.Last())); + return Task.FromResult(HttpUtility.UrlDecode(uri.Segments.Last())); } private async Task GetInfo(String torrentId) diff --git a/server/RdtClient.Service/Services/TorrentClients/ITorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/ITorrentClient.cs index 2813da8..38121ae 100644 --- a/server/RdtClient.Service/Services/TorrentClients/ITorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/ITorrentClient.cs @@ -15,5 +15,5 @@ public interface ITorrentClient Task Unrestrict(String link); Task UpdateData(Torrent torrent, TorrentClientTorrent? torrentClientTorrent); Task?> GetDownloadLinks(Torrent torrent); - Task GetFileName(String downloadUrl); + Task GetFileName(String downloadUrl); } \ No newline at end of file diff --git a/server/RdtClient.Service/Services/TorrentClients/PremiumizeTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/PremiumizeTorrentClient.cs index b91790b..4a1745b 100644 --- a/server/RdtClient.Service/Services/TorrentClients/PremiumizeTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/PremiumizeTorrentClient.cs @@ -242,16 +242,16 @@ public class PremiumizeTorrentClient(ILogger logger, IH return downloadLinks; } - public Task GetFileName(String downloadUrl) + public Task GetFileName(String downloadUrl) { if (String.IsNullOrWhiteSpace(downloadUrl)) { - return Task.FromResult(null); + return Task.FromResult(""); } var uri = new Uri(downloadUrl); - return Task.FromResult(HttpUtility.UrlDecode(uri.Segments.Last())); + return Task.FromResult(HttpUtility.UrlDecode(uri.Segments.Last())); } private async Task GetInfo(String id) diff --git a/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs index 459cb7a..42b06d2 100644 --- a/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/RealDebridTorrentClient.cs @@ -396,16 +396,16 @@ public class RealDebridTorrentClient(ILogger logger, IH return null; } - public Task GetFileName(String downloadUrl) + public Task GetFileName(String downloadUrl) { if (String.IsNullOrWhiteSpace(downloadUrl)) { - return Task.FromResult(null); + return Task.FromResult(""); } var uri = new Uri(downloadUrl); - return Task.FromResult(HttpUtility.UrlDecode(uri.Segments.Last())); + return Task.FromResult(HttpUtility.UrlDecode(uri.Segments.Last())); } private DateTimeOffset? ChangeTimeZone(DateTimeOffset? dateTimeOffset) diff --git a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs index 6ebe877..1782391 100644 --- a/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs +++ b/server/RdtClient.Service/Services/TorrentClients/TorBoxTorrentClient.cs @@ -302,11 +302,11 @@ public class TorBoxTorrentClient(ILogger logger, IHttpClien return files; } - public async Task GetFileName(String downloadUrl) + public async Task GetFileName(String downloadUrl) { if (String.IsNullOrWhiteSpace(downloadUrl)) { - return null; + return ""; } var uri = new Uri(downloadUrl); diff --git a/server/RdtClient.Service/Services/Torrents.cs b/server/RdtClient.Service/Services/Torrents.cs index 4f7b0a5..28a45b2 100644 --- a/server/RdtClient.Service/Services/Torrents.cs +++ b/server/RdtClient.Service/Services/Torrents.cs @@ -374,7 +374,7 @@ public class Torrents( { var download = await downloads.GetById(downloadId) ?? throw new($"Download with ID {downloadId} not found"); - Log($"Unrestricting link", download, download.Torrent); + Log($"Retrieving filename for", download, download.Torrent); var fileName = await TorrentClient.GetFileName(download.Link!);