Use generic Enum overloads to resolve CA2263 warnings

Replace Enum.Parse(typeof(T), ...) and Enum.GetNames(typeof(T)) with
their generic counterparts Enum.Parse<T>() and Enum.GetNames<T>() in
MediaBrowser.Model/Dlna for improved type safety.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jaxx2104
2026-03-11 23:57:30 +09:00
parent 08f9ec5d37
commit e4eba084dd
2 changed files with 2 additions and 2 deletions

View File

@@ -324,7 +324,7 @@ namespace MediaBrowser.Model.Dlna
return !condition.IsRequired;
}
var expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true);
var expected = Enum.Parse<TransportStreamTimestamp>(condition.Value, true);
switch (condition.Condition)
{

View File

@@ -2009,7 +2009,7 @@ namespace MediaBrowser.Model.Dlna
}
else if (condition.Condition == ProfileConditionType.NotEquals)
{
item.SetOption(qualifier, "rangetype", string.Join(',', Enum.GetNames(typeof(VideoRangeType)).Except(values)));
item.SetOption(qualifier, "rangetype", string.Join(',', Enum.GetNames<VideoRangeType>().Except(values)));
}
else if (condition.Condition == ProfileConditionType.EqualsAny)
{