mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-23 17:24:46 +03:00
Add some simple tests
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
|
||||
namespace Emby.Server.Implementations.Services
|
||||
{
|
||||
@@ -81,7 +82,7 @@ namespace Emby.Server.Implementations.Services
|
||||
if (propertySerializerEntry.PropertyType == typeof(bool))
|
||||
{
|
||||
//InputExtensions.cs#530 MVC Checkbox helper emits extra hidden input field, generating 2 values, first is the real value
|
||||
propertyTextValue = LeftPart(propertyTextValue, ',');
|
||||
propertyTextValue = StringExtensions.LeftPart(propertyTextValue, ',').ToString();
|
||||
}
|
||||
|
||||
var value = propertySerializerEntry.PropertyParseStringFn(propertyTextValue);
|
||||
@@ -95,19 +96,6 @@ namespace Emby.Server.Implementations.Services
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static string LeftPart(string strVal, char needle)
|
||||
{
|
||||
if (strVal == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var pos = strVal.IndexOf(needle);
|
||||
return pos == -1
|
||||
? strVal
|
||||
: strVal.Substring(0, pos);
|
||||
}
|
||||
}
|
||||
|
||||
internal static class TypeAccessor
|
||||
|
||||
Reference in New Issue
Block a user