1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00

Fixed SeedConfigProvider cache refresh after indexer settings change

(cherry picked from commit 8e46362ff9de34c3468290861f0606d8fecc1a44)
This commit is contained in:
Taloth Saldono 2021-04-23 19:18:09 +02:00 committed by Qstick
parent 8b93038937
commit e9dffb4819
2 changed files with 3 additions and 19 deletions

View File

@ -1,17 +0,0 @@
using NzbDrone.Common.Messaging;
using NzbDrone.Core.ThingiProvider;
namespace NzbDrone.Core.Indexers
{
public class IndexerSettingUpdatedEvent : IEvent
{
public string IndexerName { get; private set; }
public IProviderConfig IndexerSetting { get; private set; }
public IndexerSettingUpdatedEvent(string indexerName, IProviderConfig indexerSetting)
{
IndexerName = indexerName;
IndexerSetting = indexerSetting;
}
}
}

View File

@ -4,6 +4,7 @@
using NzbDrone.Core.Download.Clients;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.ThingiProvider.Events;
namespace NzbDrone.Core.Indexers
{
@ -13,7 +14,7 @@ public interface ISeedConfigProvider
TorrentSeedConfiguration GetSeedConfiguration(int indexerId);
}
public class SeedConfigProvider : ISeedConfigProvider, IHandle<IndexerSettingUpdatedEvent>
public class SeedConfigProvider : ISeedConfigProvider, IHandle<ProviderUpdatedEvent<IIndexer>>
{
private readonly IIndexerFactory _indexerFactory;
private readonly ICached<SeedCriteriaSettings> _cache;
@ -83,7 +84,7 @@ private SeedCriteriaSettings FetchSeedCriteria(int indexerId)
}
}
public void Handle(IndexerSettingUpdatedEvent message)
public void Handle(ProviderUpdatedEvent<IIndexer> message)
{
_cache.Clear();
}