fixes #719 - Artist.LocalTitle with more than one period in name truncates name

This commit is contained in:
Luke Pulverenti 2014-05-31 23:19:06 -04:00
parent a6d06bf25f
commit 6f2e74f76c
2 changed files with 8 additions and 17 deletions

View File

@ -169,15 +169,7 @@ namespace MediaBrowser.Providers.Manager
/// <returns>ItemUpdateType.</returns>
protected virtual ItemUpdateType BeforeSave(TItemType item)
{
var updateType = ItemUpdateType.None;
if (string.IsNullOrEmpty(item.Name) && !string.IsNullOrEmpty(item.Path))
{
item.Name = Path.GetFileNameWithoutExtension(item.Path);
updateType = updateType | ItemUpdateType.MetadataDownload;
}
return updateType;
return ItemUpdateType.None;
}
/// <summary>
@ -311,11 +303,6 @@ namespace MediaBrowser.Providers.Manager
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.ImageUpdate;
}
if (string.IsNullOrWhiteSpace(localItem.Item.Name))
{
localItem.Item.Name = item.Name ?? Path.GetFileNameWithoutExtension(item.Path);
}
MergeData(localItem.Item, temp, new List<MetadataFields>(), !options.ReplaceAllMetadata, true);
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;

View File

@ -1,7 +1,7 @@
using System;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Providers.Manager
@ -14,7 +14,11 @@ namespace MediaBrowser.Providers.Manager
{
if (replaceData || string.IsNullOrEmpty(target.Name))
{
target.Name = source.Name;
// Safeguard against incoming data having an emtpy name
if (!string.IsNullOrWhiteSpace(source.Name))
{
target.Name = source.Name;
}
}
}