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

This commit is contained in:
Luke Pulverenti 2013-04-19 19:43:00 -04:00
parent 39044fea9a
commit 6ddb9958c4

View File

@ -147,7 +147,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
var newValue = Task.FromResult(userData); var newValue = Task.FromResult(userData);
// Once it succeeds, put it into the dictionary to make it available to everyone else // 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) 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> /// <summary>
/// Persists the user data. /// Persists the user data.
/// </summary> /// </summary>
@ -223,7 +234,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
throw new ArgumentNullException("key"); throw new ArgumentNullException("key");
} }
return _userData.GetOrAdd(key, keyName => RetrieveUserData(userId, key)); return _userData.GetOrAdd(GetInternalKey(userId, key), keyName => RetrieveUserData(userId, key));
} }
/// <summary> /// <summary>