Address comments

This commit is contained in:
Bond_009 2021-09-24 20:15:10 +02:00
parent 086d5925c9
commit 5fd315b17c
2 changed files with 4 additions and 4 deletions

View File

@ -1610,7 +1610,7 @@ namespace Emby.Server.Implementations.Data
if (reader.TryGetString(index++, out var lockedFields))
{
List<MetadataField> fields = null;
foreach (var i in lockedFields.Split('|'))
foreach (var i in lockedFields.AsSpan().Split('|'))
{
if (Enum.TryParse(i, true, out MetadataField parsedValue))
{
@ -1645,7 +1645,7 @@ namespace Emby.Server.Implementations.Data
if (reader.TryGetString(index, out var trailerTypes))
{
List<TrailerType> types = null;
foreach (var i in trailerTypes.Split('|'))
foreach (var i in trailerTypes.AsSpan().Split('|'))
{
if (Enum.TryParse(i, true, out TrailerType parsedValue))
{
@ -1653,7 +1653,7 @@ namespace Emby.Server.Implementations.Data
}
}
trailer.TrailerTypes = types.ToArray() ?? Array.Empty<TrailerType>();
trailer.TrailerTypes = types?.ToArray() ?? Array.Empty<TrailerType>();
}
}

View File

@ -171,7 +171,7 @@ namespace MediaBrowser.Model.Net
/// Gets the type of the MIME.
/// </summary>
/// <param name="filename">The filename to find the MIME type of.</param>
/// <param name="defaultValue">Theefault value to return if no fitting MIME type is found.</param>
/// <param name="defaultValue">The default value to return if no fitting MIME type is found.</param>
/// <returns>The correct MIME type for the given filename, or <paramref name="defaultValue"/> if it wasn't found.</returns>
[return: NotNullIfNotNullAttribute("defaultValue")]
public static string? GetMimeType(string filename, string? defaultValue = null)