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

This commit is contained in:
Qstick
2017-10-29 21:22:58 -04:00
parent bff3a55ff3
commit d3aa032cf5
3 changed files with 27 additions and 1 deletions
@@ -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));
@@ -37,6 +38,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();