remove span based setproviderid

This commit is contained in:
cvium 2021-04-30 23:35:29 +02:00
parent ba2e346d12
commit 716cbb0695
2 changed files with 1 additions and 31 deletions

View File

@ -1012,7 +1012,7 @@ namespace Emby.Server.Implementations.Data
var providerDelimiterIndex = part.IndexOf('='); var providerDelimiterIndex = part.IndexOf('=');
if (providerDelimiterIndex != -1 && providerDelimiterIndex == part.LastIndexOf('=')) if (providerDelimiterIndex != -1 && providerDelimiterIndex == part.LastIndexOf('='))
{ {
item.SetProviderId(part.Slice(0, providerDelimiterIndex), part.Slice(providerDelimiterIndex + 1)); item.SetProviderId(part.Slice(0, providerDelimiterIndex).ToString(), part.Slice(providerDelimiterIndex + 1).ToString());
} }
} }
} }

View File

@ -132,36 +132,6 @@ namespace MediaBrowser.Model.Entities
} }
} }
/// <summary>
/// Sets a provider id.
/// </summary>
/// <param name="instance">The instance.</param>
/// <param name="name">The name.</param>
/// <param name="value">The value.</param>
public static void SetProviderId(this IHasProviderIds instance, ReadOnlySpan<char> name, ReadOnlySpan<char> value)
{
if (instance == null)
{
throw new ArgumentNullException(nameof(instance));
}
// If it's null remove the key from the dictionary
if (value.IsEmpty)
{
instance.ProviderIds?.Remove(name.ToString());
}
else
{
// Ensure it exists
if (instance.ProviderIds == null)
{
instance.ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
instance.ProviderIds[name.ToString()] = value.ToString();
}
}
/// <summary> /// <summary>
/// Sets a provider id. /// Sets a provider id.
/// </summary> /// </summary>