move provider project towards portability

This commit is contained in:
Luke Pulverenti
2016-10-26 14:25:03 -04:00
parent 4b51233cc8
commit 0189f4c49d
12 changed files with 186 additions and 130 deletions

View File

@@ -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;