Fixed issue with deleting torrents and a null reference error.
This commit is contained in:
parent
914272d6d7
commit
0220b18017
2 changed files with 4 additions and 6 deletions
|
|
@ -67,7 +67,7 @@ namespace RdtClient.Data.Data
|
||||||
var results = await _dataContext.Torrents
|
var results = await _dataContext.Torrents
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.Include(m => m.Downloads)
|
.Include(m => m.Downloads)
|
||||||
.FirstOrDefaultAsync(m => m.Hash == hash);
|
.FirstOrDefaultAsync(m => m.Hash.ToLower() == hash.ToLower());
|
||||||
|
|
||||||
if (results != null)
|
if (results != null)
|
||||||
{
|
{
|
||||||
|
|
@ -86,7 +86,7 @@ namespace RdtClient.Data.Data
|
||||||
{
|
{
|
||||||
TorrentId = Guid.NewGuid(),
|
TorrentId = Guid.NewGuid(),
|
||||||
RdId = realDebridId,
|
RdId = realDebridId,
|
||||||
Hash = hash,
|
Hash = hash.ToLower(),
|
||||||
Status = TorrentStatus.RealDebrid,
|
Status = TorrentStatus.RealDebrid,
|
||||||
AutoDownload = autoDownload,
|
AutoDownload = autoDownload,
|
||||||
AutoDelete = autoDelete
|
AutoDelete = autoDelete
|
||||||
|
|
|
||||||
|
|
@ -142,10 +142,9 @@ namespace RdtClient.Service.Services
|
||||||
var newTorrent = await _torrentData.Add(rdTorrent.Id, rdTorrent.Hash, false, false);
|
var newTorrent = await _torrentData.Add(rdTorrent.Id, rdTorrent.Hash, false, false);
|
||||||
await GetById(newTorrent.TorrentId);
|
await GetById(newTorrent.TorrentId);
|
||||||
}
|
}
|
||||||
|
else if (rdTorrent.Files == null)
|
||||||
if (rdTorrent.Files == null)
|
|
||||||
{
|
{
|
||||||
var rdTorrent2 = await _rdtClient.GetTorrentInfoAsync(rdTorrent.Id);
|
var rdTorrent2 = await RdNetClient.GetTorrentInfoAsync(rdTorrent.Id);
|
||||||
await Update(torrent, rdTorrent2);
|
await Update(torrent, rdTorrent2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -360,7 +359,6 @@ namespace RdtClient.Service.Services
|
||||||
if (!rdTorrent.Files.Any(m => m.Selected))
|
if (!rdTorrent.Files.Any(m => m.Selected))
|
||||||
{
|
{
|
||||||
var fileIds = rdTorrent.Files
|
var fileIds = rdTorrent.Files
|
||||||
.Where(m => m.Bytes > 1024 * 10)
|
|
||||||
.Select(m => m.Id.ToString())
|
.Select(m => m.Id.ToString())
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue