mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-17 07:49:45 +02:00
Fixed: Prevent unknown settings implementation from failing to deserialize
(cherry picked from commit 0e2cc7851f556e928e52bb2886c7d60c13b0741e) Log removal of invalid definitions as warnings (cherry picked from commit 3d61719a2cc9c87ac3c92b5358bb5034aed4c2ff) (cherry picked from commit 498722b240c17d310863ed604c441a9c507ddcd6)
This commit is contained in:
parent
8b291d932f
commit
84bf30dcda
@ -169,14 +169,13 @@ public virtual void SetProviderCharacteristics(TProvider provider, TProviderDefi
|
||||
definition.Message = provider.Message;
|
||||
}
|
||||
|
||||
// TODO: Remove providers even if the ConfigContract can't be deserialized (this will fail to remove providers if the settings can't be deserialized).
|
||||
private void RemoveMissingImplementations()
|
||||
{
|
||||
var storedProvider = _providerRepository.All();
|
||||
|
||||
foreach (var invalidDefinition in storedProvider.Where(def => GetImplementation(def) == null))
|
||||
{
|
||||
_logger.Debug("Removing {0} ", invalidDefinition.Name);
|
||||
_logger.Warn("Removing {0}", invalidDefinition.Name);
|
||||
_providerRepository.Delete(invalidDefinition);
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ protected override List<TProviderDefinition> Query(SqlBuilder builder)
|
||||
var item = parser(reader);
|
||||
var impType = typeof(IProviderConfig).Assembly.FindTypeByName(item.ConfigContract);
|
||||
|
||||
if (body.IsNullOrWhiteSpace())
|
||||
if (body.IsNullOrWhiteSpace() || impType == null)
|
||||
{
|
||||
item.Settings = NullConfig.Instance;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user