From 71697f993f87a6dfbf442ab5da08c036d3c5c328 Mon Sep 17 00:00:00 2001 From: Roger Far Date: Thu, 15 Oct 2020 07:28:44 -0600 Subject: [PATCH] Fixed small issues when adding torrents and not loading meta data. --- .gitignore | 1 + server/RdtClient.Service/Services/DownloadManager.cs | 7 +++++++ server/RdtClient.Service/Services/Torrents.cs | 11 ++++++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b9a3b14..28d24f4 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ server/**/*.user server/**/.vs server/RdtClient.Web/wwwroot/ +build/ \ No newline at end of file diff --git a/server/RdtClient.Service/Services/DownloadManager.cs b/server/RdtClient.Service/Services/DownloadManager.cs index f90af0d..5959e1f 100644 --- a/server/RdtClient.Service/Services/DownloadManager.cs +++ b/server/RdtClient.Service/Services/DownloadManager.cs @@ -145,6 +145,11 @@ namespace RdtClient.Service.Services extractPath = Path.Combine(destinationFolderPath, torrentName); } + if (entries.Any(m => m.Key.Contains(".r00"))) + { + extractPath = Path.Combine(extractPath, "Temp"); + } + foreach (var entry in entries) { _rarCurrentEntry = entry; @@ -172,6 +177,8 @@ namespace RdtClient.Service.Services await Task.Delay(1000); } } + + } } catch diff --git a/server/RdtClient.Service/Services/Torrents.cs b/server/RdtClient.Service/Services/Torrents.cs index f15fc4e..e7110b2 100644 --- a/server/RdtClient.Service/Services/Torrents.cs +++ b/server/RdtClient.Service/Services/Torrents.cs @@ -121,14 +121,15 @@ namespace RdtClient.Service.Services public async Task> Update() { - var torrents = await _torrentData.Get(); - var w = await SemaphoreSlim.WaitAsync(1); + if (!w) { - return torrents; + return await _torrentData.Get(); } + var torrents = await _torrentData.Get(); + try { var rdTorrents = await RdNetClient.GetTorrentsAsync(0, 100); @@ -269,10 +270,10 @@ namespace RdtClient.Service.Services private async Task Add(String rdTorrentId, String infoHash, Boolean autoDownload, Boolean autoDelete) { - var w = await SemaphoreSlim.WaitAsync(1); + var w = await SemaphoreSlim.WaitAsync(60000); if (!w) { - return; + throw new Exception("Unable to add torrent, could not obtain lock"); } try