1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

Fixed: Don't attempt to fetch a release if the download client is disabled

This commit is contained in:
Mark McDowall
2017-09-01 22:33:10 -07:00
parent 6626397350
commit 5372ed5d40
3 changed files with 30 additions and 3 deletions
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using NLog;
@@ -10,6 +10,7 @@ namespace NzbDrone.Core.ThingiProvider.Status
public interface IProviderStatusServiceBase<TModel>
where TModel : ProviderStatusBase, new()
{
bool IsDisabled(int providerId);
List<TModel> GetBlockedProviders();
void RecordSuccess(int providerId);
void RecordFailure(int providerId, TimeSpan minimumBackOff = default(TimeSpan));
@@ -36,6 +37,11 @@ namespace NzbDrone.Core.ThingiProvider.Status
_logger = logger;
}
public bool IsDisabled(int providerId)
{
return GetProviderStatus(providerId).IsDisabled();
}
public virtual List<TModel> GetBlockedProviders()
{
return _providerStatusRepository.All().Where(v => v.IsDisabled()).ToList();