aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-10-26 14:25:03 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-10-26 14:25:03 -0400
commit0189f4c49dc89654e6aa10c5dd0fc50a0984bfec (patch)
tree63f142411e538d5c6c6949299e82913d7441cc1b /MediaBrowser.Server.Implementations
parent4b51233cc8faeea344661a2a3427579e534d8ea4 (diff)
move provider project towards portability
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index bc62516c7..667f6b89a 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -1112,7 +1112,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
private string SerializeProviderIds(BaseItem item)
{
- var ids = item.ProviderIds.ToList();
+ // Ideally we shouldn't need this IsNullOrWhiteSpace check but we're seeing some cases of bad data slip through
+ var ids = item.ProviderIds
+ .Where(i => !string.IsNullOrWhiteSpace(i.Value))
+ .ToList();
if (ids.Count == 0)
{
@@ -4889,6 +4892,15 @@ namespace MediaBrowser.Server.Implementations.Persistence
foreach (var pair in newValues)
{
+ if (string.IsNullOrWhiteSpace(pair.Key))
+ {
+ continue;
+ }
+ if (string.IsNullOrWhiteSpace(pair.Value))
+ {
+ continue;
+ }
+
_saveProviderIdsCommand.GetParameter(0).Value = itemId;
_saveProviderIdsCommand.GetParameter(1).Value = pair.Key;
_saveProviderIdsCommand.GetParameter(2).Value = pair.Value;