diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs
index 37553e4a4..4f49dd37d 100644
--- a/MediaBrowser.Api/UserService.cs
+++ b/MediaBrowser.Api/UserService.cs
@@ -455,7 +455,7 @@ namespace MediaBrowser.Api
var user = _userManager.GetUserById(id);
- var task = user.Name.Equals(dtoUser.Name, StringComparison.Ordinal) ?
+ var task = string.Equals(user.Name, dtoUser.Name, StringComparison.Ordinal) ?
_userManager.UpdateUser(user) :
_userManager.RenameUser(user, dtoUser.Name);
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index b819d14e5..67be6c2ce 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -894,12 +894,14 @@ namespace MediaBrowser.Controller.Entities
/// System.String.
public string GetUserDataKey()
{
- if (!string.IsNullOrWhiteSpace(_userDataKey))
+ if (string.IsNullOrWhiteSpace(_userDataKey))
{
- return _userDataKey;
+ var key = CreateUserDataKey();
+ _userDataKey = key;
+ return key;
}
- return _userDataKey ?? (_userDataKey = CreateUserDataKey());
+ return _userDataKey;
}
protected virtual string CreateUserDataKey()
@@ -914,6 +916,12 @@ namespace MediaBrowser.Controller.Entities
return current.IsInMixedFolder == newItem.IsInMixedFolder;
}
+ public void AfterMetadataRefresh()
+ {
+ _sortName = null;
+ _userDataKey = null;
+ }
+
///
/// Gets the preferred metadata language.
///
diff --git a/MediaBrowser.Controller/Entities/CollectionFolder.cs b/MediaBrowser.Controller/Entities/CollectionFolder.cs
index f47a439a7..5452c63a4 100644
--- a/MediaBrowser.Controller/Entities/CollectionFolder.cs
+++ b/MediaBrowser.Controller/Entities/CollectionFolder.cs
@@ -121,12 +121,6 @@ namespace MediaBrowser.Controller.Entities
return args;
}
- // Cache this since it will be used a lot
- ///
- /// The null task result
- ///
- private static readonly Task NullTaskResult = Task.FromResult