Fixed small issues when adding torrents and not loading meta data.

This commit is contained in:
Roger Far 2020-10-15 07:28:44 -06:00
parent 22494a1cad
commit 71697f993f
3 changed files with 14 additions and 5 deletions

1
.gitignore vendored
View file

@ -37,3 +37,4 @@ server/**/*.user
server/**/.vs
server/RdtClient.Web/wwwroot/
build/

View file

@ -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

View file

@ -121,14 +121,15 @@ namespace RdtClient.Service.Services
public async Task<IList<Torrent>> 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