New: Log additional information when processing completed torrents from rTorrent

Closes #5638
This commit is contained in:
Mark McDowall 2023-05-11 17:35:40 -07:00
parent 3af7a6df7d
commit c7d39579b4
1 changed files with 22 additions and 6 deletions

View File

@ -179,12 +179,28 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
// Grab cached seedConfig
var seedConfig = _downloadSeedConfigProvider.GetSeedConfiguration(torrent.Hash);
// Check if torrent is finished and if it exceeds cached seedConfig
item.CanMoveFiles = item.CanBeRemoved =
torrent.IsFinished && seedConfig != null &&
(
(torrent.Ratio / 1000.0) >= seedConfig.Ratio ||
(DateTimeOffset.Now - DateTimeOffset.FromUnixTimeSeconds(torrent.FinishedTime)) >= seedConfig.SeedTime);
if (torrent.IsFinished && seedConfig != null)
{
var canRemove = false;
if (torrent.Ratio / 1000.0 >= seedConfig.Ratio)
{
_logger.Trace($"{item} has met seed ratio goal of {seedConfig.Ratio}");
canRemove = true;
}
else if (DateTimeOffset.Now - DateTimeOffset.FromUnixTimeSeconds(torrent.FinishedTime) >= seedConfig.SeedTime)
{
_logger.Trace($"{item} has met seed time goal of {seedConfig.SeedTime} minutes");
canRemove = true;
}
else
{
_logger.Trace($"{item} seeding goals have not yet been reached");
}
// Check if torrent is finished and if it exceeds cached seedConfig
item.CanMoveFiles = item.CanBeRemoved = canRemove;
}
items.Add(item);
}