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

@ -332,9 +332,17 @@ public class TorrentRunner(ILogger<TorrentRunner> logger, Torrents torrents, Dow
var dequeueCount = maxParallelDownloads == 0 ? torrentsToAddToProvider.Count : maxParallelDownloads - downloadingTorrentsCount; var dequeueCount = maxParallelDownloads == 0 ? torrentsToAddToProvider.Count : maxParallelDownloads - downloadingTorrentsCount;
foreach (var torrent in torrentsToAddToProvider.Take(dequeueCount)) foreach (var torrent in torrentsToAddToProvider.Take(dequeueCount))
{
try
{ {
await torrents.DequeueFromDebridQueue(torrent); 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);
}
}
} }
allTorrents = await torrents.Get(); allTorrents = await torrents.Get();

View file

@ -523,7 +523,7 @@ public class Torrents(
{ {
var rdTorrent = rdTorrents.FirstOrDefault(m => m.Id == torrent.RdId); 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); await Delete(torrent.TorrentId, true, false, true);
} }