add content type error handling
This commit is contained in:
parent
e265d8efec
commit
b23bdfe9f2
|
@ -5267,11 +5267,19 @@ namespace Emby.Server.Implementations.Data
|
|||
{
|
||||
foreach (var pair in values)
|
||||
{
|
||||
var itemValue = pair.Item2;
|
||||
|
||||
// Don't save if invalid
|
||||
if (string.IsNullOrWhiteSpace(itemValue))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
statement.Reset();
|
||||
|
||||
statement.TryBind("@ItemId", itemId.ToGuidParamValue());
|
||||
statement.TryBind("@Type", pair.Item1);
|
||||
statement.TryBind("@Value", pair.Item2);
|
||||
statement.TryBind("@Value", itemValue);
|
||||
|
||||
if (pair.Item2 == null)
|
||||
{
|
||||
|
|
|
@ -3084,7 +3084,11 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
foreach (var contentType in ConfigurationManager.Configuration.ContentTypes)
|
||||
{
|
||||
if (string.Equals(path, contentType.Name, StringComparison.OrdinalIgnoreCase)
|
||||
if (string.IsNullOrWhiteSpace(contentType.Name))
|
||||
{
|
||||
removeList.Add(contentType);
|
||||
}
|
||||
else if (string.Equals(path, contentType.Name, StringComparison.OrdinalIgnoreCase)
|
||||
|| _fileSystem.ContainsSubPath(path, contentType.Name))
|
||||
{
|
||||
removeList.Add(contentType);
|
||||
|
|
|
@ -99,6 +99,7 @@ namespace MediaBrowser.Api
|
|||
var path = item.ContainingFolderPath;
|
||||
|
||||
var types = _config.Configuration.ContentTypes
|
||||
.Where(i => !string.IsNullOrWhiteSpace(i.Name))
|
||||
.Where(i => !string.Equals(i.Name, path, StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user