Address comments
This commit is contained in:
parent
086d5925c9
commit
5fd315b17c
|
@ -1610,7 +1610,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
if (reader.TryGetString(index++, out var lockedFields))
|
if (reader.TryGetString(index++, out var lockedFields))
|
||||||
{
|
{
|
||||||
List<MetadataField> fields = null;
|
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))
|
if (Enum.TryParse(i, true, out MetadataField parsedValue))
|
||||||
{
|
{
|
||||||
|
@ -1645,7 +1645,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
if (reader.TryGetString(index, out var trailerTypes))
|
if (reader.TryGetString(index, out var trailerTypes))
|
||||||
{
|
{
|
||||||
List<TrailerType> types = null;
|
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))
|
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>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,7 @@ namespace MediaBrowser.Model.Net
|
||||||
/// Gets the type of the MIME.
|
/// Gets the type of the MIME.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="filename">The filename to find the MIME type of.</param>
|
/// <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>
|
/// <returns>The correct MIME type for the given filename, or <paramref name="defaultValue"/> if it wasn't found.</returns>
|
||||||
[return: NotNullIfNotNullAttribute("defaultValue")]
|
[return: NotNullIfNotNullAttribute("defaultValue")]
|
||||||
public static string? GetMimeType(string filename, string? defaultValue = null)
|
public static string? GetMimeType(string filename, string? defaultValue = null)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user