Add check if torrent is actually changed from RD to prevent DB updates.

This commit is contained in:
Roger Far 2021-06-05 11:46:59 -06:00
parent 7872836ae7
commit 5e490e8b0d

View file

@ -440,6 +440,8 @@ namespace RdtClient.Service.Services
private async Task Update(Torrent torrent)
{
var originalTorrent = JsonConvert.SerializeObject(torrent);
var rdTorrent = await GetRdNetClient().GetTorrentInfoAsync(torrent.RdId);
if (!String.IsNullOrWhiteSpace(rdTorrent.Filename))
@ -491,7 +493,12 @@ namespace RdtClient.Service.Services
_ => RealDebridStatus.Error
};
await _torrentData.UpdateRdData(torrent);
var newTorrent = JsonConvert.SerializeObject(torrent);
if (originalTorrent != newTorrent)
{
await _torrentData.UpdateRdData(torrent);
}
}
}
}