aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Data/SqliteItemRepository.cs10
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs6
2 files changed, 14 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
index 8e6a277a4..8c16216b9 100644
--- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs
@@ -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)
{
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 5bf53fcb4..4c788a2ab 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -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);