fixes #168 - Resumable & Favorite items showing up for all users.

pull/702/head
Luke Pulverenti 12 years ago
parent 39044fea9a
commit 6ddb9958c4

@ -147,7 +147,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
var newValue = Task.FromResult(userData);
// Once it succeeds, put it into the dictionary to make it available to everyone else
_userData.AddOrUpdate(key, newValue, delegate { return newValue; });
_userData.AddOrUpdate(GetInternalKey(userId, key), newValue, delegate { return newValue; });
}
catch (Exception ex)
{
@ -157,6 +157,17 @@ namespace MediaBrowser.Server.Implementations.Sqlite
}
}
/// <summary>
/// Gets the internal key.
/// </summary>
/// <param name="userId">The user id.</param>
/// <param name="key">The key.</param>
/// <returns>System.String.</returns>
private string GetInternalKey(Guid userId, string key)
{
return userId + key;
}
/// <summary>
/// Persists the user data.
/// </summary>
@ -223,7 +234,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
throw new ArgumentNullException("key");
}
return _userData.GetOrAdd(key, keyName => RetrieveUserData(userId, key));
return _userData.GetOrAdd(GetInternalKey(userId, key), keyName => RetrieveUserData(userId, key));
}
/// <summary>

Loading…
Cancel
Save