Fixed bug where original filename wasn't handled properly.
This commit is contained in:
parent
fe3b7d8867
commit
5bdf224e1b
1 changed files with 13 additions and 19 deletions
|
|
@ -101,9 +101,7 @@ namespace RdtClient.Service.Services
|
||||||
|
|
||||||
if (torrent != null)
|
if (torrent != null)
|
||||||
{
|
{
|
||||||
var rdTorrent = await GetRdNetClient().GetTorrentInfoAsync(torrent.RdId);
|
await Update(torrent);
|
||||||
|
|
||||||
await Update(torrent, rdTorrent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return torrent;
|
return torrent;
|
||||||
|
|
@ -115,9 +113,7 @@ namespace RdtClient.Service.Services
|
||||||
|
|
||||||
if (torrent != null)
|
if (torrent != null)
|
||||||
{
|
{
|
||||||
var rdTorrent = await GetRdNetClient().GetTorrentInfoAsync(torrent.RdId);
|
await Update(torrent);
|
||||||
|
|
||||||
await Update(torrent, rdTorrent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return torrent;
|
return torrent;
|
||||||
|
|
@ -336,9 +332,7 @@ namespace RdtClient.Service.Services
|
||||||
|
|
||||||
var newTorrent = await _torrentData.Add(rdTorrentId, infoHash, category, autoDelete, fileOrMagnetContents, isFile);
|
var newTorrent = await _torrentData.Add(rdTorrentId, infoHash, category, autoDelete, fileOrMagnetContents, isFile);
|
||||||
|
|
||||||
var rdTorrent = await GetRdNetClient().GetTorrentInfoAsync(rdTorrentId);
|
await Update(newTorrent);
|
||||||
|
|
||||||
await Update(newTorrent, rdTorrent);
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
@ -369,15 +363,8 @@ namespace RdtClient.Service.Services
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (rdTorrent.Files == null)
|
|
||||||
{
|
await Update(torrent);
|
||||||
var rdTorrentInfo = await GetRdNetClient().GetTorrentInfoAsync(rdTorrent.Id);
|
|
||||||
await Update(torrent, rdTorrentInfo);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await Update(torrent, rdTorrent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var torrent in torrents)
|
foreach (var torrent in torrents)
|
||||||
|
|
@ -451,13 +438,20 @@ namespace RdtClient.Service.Services
|
||||||
return settingDownloadPath;
|
return settingDownloadPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Update(Torrent torrent, RDNET.Torrent rdTorrent)
|
private async Task Update(Torrent torrent)
|
||||||
{
|
{
|
||||||
|
var rdTorrent = await GetRdNetClient().GetTorrentInfoAsync(torrent.RdId);
|
||||||
|
|
||||||
if (!String.IsNullOrWhiteSpace(rdTorrent.Filename))
|
if (!String.IsNullOrWhiteSpace(rdTorrent.Filename))
|
||||||
{
|
{
|
||||||
torrent.RdName = rdTorrent.Filename;
|
torrent.RdName = rdTorrent.Filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!String.IsNullOrWhiteSpace(rdTorrent.OriginalFilename))
|
||||||
|
{
|
||||||
|
torrent.RdName = rdTorrent.Filename;
|
||||||
|
}
|
||||||
|
|
||||||
if (rdTorrent.Bytes > 0)
|
if (rdTorrent.Bytes > 0)
|
||||||
{
|
{
|
||||||
torrent.RdSize = rdTorrent.Bytes;
|
torrent.RdSize = rdTorrent.Bytes;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue