Add check if torrent is actually changed from RD to prevent DB updates.
This commit is contained in:
parent
7872836ae7
commit
5e490e8b0d
1 changed files with 8 additions and 1 deletions
|
|
@ -440,6 +440,8 @@ namespace RdtClient.Service.Services
|
||||||
|
|
||||||
private async Task Update(Torrent torrent)
|
private async Task Update(Torrent torrent)
|
||||||
{
|
{
|
||||||
|
var originalTorrent = JsonConvert.SerializeObject(torrent);
|
||||||
|
|
||||||
var rdTorrent = await GetRdNetClient().GetTorrentInfoAsync(torrent.RdId);
|
var rdTorrent = await GetRdNetClient().GetTorrentInfoAsync(torrent.RdId);
|
||||||
|
|
||||||
if (!String.IsNullOrWhiteSpace(rdTorrent.Filename))
|
if (!String.IsNullOrWhiteSpace(rdTorrent.Filename))
|
||||||
|
|
@ -491,7 +493,12 @@ namespace RdtClient.Service.Services
|
||||||
_ => RealDebridStatus.Error
|
_ => RealDebridStatus.Error
|
||||||
};
|
};
|
||||||
|
|
||||||
await _torrentData.UpdateRdData(torrent);
|
var newTorrent = JsonConvert.SerializeObject(torrent);
|
||||||
|
|
||||||
|
if (originalTorrent != newTorrent)
|
||||||
|
{
|
||||||
|
await _torrentData.UpdateRdData(torrent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue