mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-16 23:39:44 +02:00
Cleanup other provider status code
(cherry picked from commit c281a7818adce8db728d2a104f4444cb9c0baf2c)
This commit is contained in:
parent
fa80e8b7a2
commit
0e83c42f3a
@ -56,11 +56,11 @@ public List<IDownloadClient> DownloadHandlingEnabled(bool filterBlockedClients =
|
|||||||
|
|
||||||
private IEnumerable<IDownloadClient> FilterBlockedClients(IEnumerable<IDownloadClient> clients)
|
private IEnumerable<IDownloadClient> FilterBlockedClients(IEnumerable<IDownloadClient> clients)
|
||||||
{
|
{
|
||||||
var blockedIndexers = _downloadClientStatusService.GetBlockedProviders().ToDictionary(v => v.ProviderId, v => v);
|
var blockedClients = _downloadClientStatusService.GetBlockedProviders().ToDictionary(v => v.ProviderId, v => v);
|
||||||
|
|
||||||
foreach (var client in clients)
|
foreach (var client in clients)
|
||||||
{
|
{
|
||||||
if (blockedIndexers.TryGetValue(client.Definition.Id, out var downloadClientStatus))
|
if (blockedClients.TryGetValue(client.Definition.Id, out var downloadClientStatus))
|
||||||
{
|
{
|
||||||
_logger.Debug("Temporarily ignoring download client {0} till {1} due to recent failures.", client.Definition.Name, downloadClientStatus.DisabledTill.Value.ToLocalTime());
|
_logger.Debug("Temporarily ignoring download client {0} till {1} due to recent failures.", client.Definition.Name, downloadClientStatus.DisabledTill.Value.ToLocalTime());
|
||||||
continue;
|
continue;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using Dapper;
|
using Dapper;
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Housekeeping.Housekeepers
|
namespace NzbDrone.Core.Housekeeping.Housekeepers
|
||||||
@ -15,6 +15,7 @@ public CleanupOrphanedDownloadClientStatus(IMainDatabase database)
|
|||||||
public void Clean()
|
public void Clean()
|
||||||
{
|
{
|
||||||
using var mapper = _database.OpenConnection();
|
using var mapper = _database.OpenConnection();
|
||||||
|
|
||||||
mapper.Execute(@"DELETE FROM ""DownloadClientStatus""
|
mapper.Execute(@"DELETE FROM ""DownloadClientStatus""
|
||||||
WHERE ""Id"" IN (
|
WHERE ""Id"" IN (
|
||||||
SELECT ""DownloadClientStatus"".""Id"" FROM ""DownloadClientStatus""
|
SELECT ""DownloadClientStatus"".""Id"" FROM ""DownloadClientStatus""
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
using NzbDrone.Core.ImportLists;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Housekeeping.Housekeepers
|
||||||
|
{
|
||||||
|
public class FixFutureImportListStatusTimes : FixFutureProviderStatusTimes<ImportListStatus>, IHousekeepingTask
|
||||||
|
{
|
||||||
|
public FixFutureImportListStatusTimes(IImportListStatusRepository importListStatusRepository)
|
||||||
|
: base(importListStatusRepository)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user