Merge pull request #794 from Cucumberrbob/fix/debrid-queue

Debrid Queue fixes (don't auto delete queued torrents, handle errors when dequeueing)
This commit is contained in:
Roger Far 2025-04-23 21:45:10 -06:00 committed by GitHub
commit fa499395bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -333,7 +333,15 @@ public class TorrentRunner(ILogger<TorrentRunner> logger, Torrents torrents, Dow
foreach (var torrent in torrentsToAddToProvider.Take(dequeueCount))
{
await torrents.DequeueFromDebridQueue(torrent);
try
{
await torrents.DequeueFromDebridQueue(torrent);
}
catch (Exception ex)
{
await torrents.UpdateComplete(torrent.TorrentId, $"Could not add to provider: {ex.Message}", DateTimeOffset.Now, true);
logger.LogWarning(ex, "Could not dequeue torrent {torrentId}", torrent.TorrentId);
}
}
}

View file

@ -523,7 +523,7 @@ public class Torrents(
{
var rdTorrent = rdTorrents.FirstOrDefault(m => m.Id == torrent.RdId);
if (rdTorrent == null && Settings.Get.Provider.AutoDelete)
if (rdTorrent == null && Settings.Get.Provider.AutoDelete && torrent.RdStatus != TorrentStatus.Queued)
{
await Delete(torrent.TorrentId, true, false, true);
}