Fixed small issues when adding torrents and not loading meta data.
This commit is contained in:
parent
22494a1cad
commit
71697f993f
3 changed files with 14 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -37,3 +37,4 @@ server/**/*.user
|
||||||
server/**/.vs
|
server/**/.vs
|
||||||
server/RdtClient.Web/wwwroot/
|
server/RdtClient.Web/wwwroot/
|
||||||
|
|
||||||
|
build/
|
||||||
|
|
@ -145,6 +145,11 @@ namespace RdtClient.Service.Services
|
||||||
extractPath = Path.Combine(destinationFolderPath, torrentName);
|
extractPath = Path.Combine(destinationFolderPath, torrentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entries.Any(m => m.Key.Contains(".r00")))
|
||||||
|
{
|
||||||
|
extractPath = Path.Combine(extractPath, "Temp");
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var entry in entries)
|
foreach (var entry in entries)
|
||||||
{
|
{
|
||||||
_rarCurrentEntry = entry;
|
_rarCurrentEntry = entry;
|
||||||
|
|
@ -172,6 +177,8 @@ namespace RdtClient.Service.Services
|
||||||
await Task.Delay(1000);
|
await Task.Delay(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
|
||||||
|
|
@ -121,14 +121,15 @@ namespace RdtClient.Service.Services
|
||||||
|
|
||||||
public async Task<IList<Torrent>> Update()
|
public async Task<IList<Torrent>> Update()
|
||||||
{
|
{
|
||||||
var torrents = await _torrentData.Get();
|
|
||||||
|
|
||||||
var w = await SemaphoreSlim.WaitAsync(1);
|
var w = await SemaphoreSlim.WaitAsync(1);
|
||||||
|
|
||||||
if (!w)
|
if (!w)
|
||||||
{
|
{
|
||||||
return torrents;
|
return await _torrentData.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var torrents = await _torrentData.Get();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var rdTorrents = await RdNetClient.GetTorrentsAsync(0, 100);
|
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)
|
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)
|
if (!w)
|
||||||
{
|
{
|
||||||
return;
|
throw new Exception("Unable to add torrent, could not obtain lock");
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue