mirror of
https://github.com/jellyfin/jellyfin
synced 2024-09-05 23:53:44 +00:00
Use TryAdd
This commit is contained in:
parent
9d738bb601
commit
6ae1903453
|
@ -73,10 +73,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
|
|||
foreach (var info in idInfos)
|
||||
{
|
||||
var id = info.Key + "Id";
|
||||
if (!_validProviderIds.ContainsKey(id))
|
||||
{
|
||||
_validProviderIds.Add(id, info.Key);
|
||||
}
|
||||
_validProviderIds.TryAdd(id, info.Key);
|
||||
}
|
||||
|
||||
// Additional Mappings
|
||||
|
|
|
@ -882,10 +882,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
var key = providerId.Key;
|
||||
|
||||
// Don't replace existing Id's.
|
||||
if (!lookupInfo.ProviderIds.ContainsKey(key))
|
||||
{
|
||||
lookupInfo.ProviderIds[key] = providerId.Value;
|
||||
}
|
||||
lookupInfo.ProviderIds.TryAdd(key, providerId.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -780,10 +780,7 @@ namespace MediaBrowser.Providers.Manager
|
|||
{
|
||||
foreach (var providerId in result.ProviderIds)
|
||||
{
|
||||
if (!existingMatch.ProviderIds.ContainsKey(providerId.Key))
|
||||
{
|
||||
existingMatch.ProviderIds.Add(providerId.Key, providerId.Value);
|
||||
}
|
||||
existingMatch.ProviderIds.TryAdd(providerId.Key, providerId.Value);
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(existingMatch.ImageUrl))
|
||||
|
|
|
@ -100,10 +100,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|||
foreach (var info in idInfos)
|
||||
{
|
||||
var id = info.Key + "Id";
|
||||
if (!_validProviderIds.ContainsKey(id))
|
||||
{
|
||||
_validProviderIds.Add(id, info.Key);
|
||||
}
|
||||
_validProviderIds.TryAdd(id, info.Key);
|
||||
}
|
||||
|
||||
// Additional Mappings
|
||||
|
|
Loading…
Reference in a new issue