The Free Software Media System - Server Backend & API
fixes #168 - Resumable & Favorite items showing up for all users.
Luke Pulverenti6ddb9958c4f7
diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.csindex 065cbd385d..8b4dcd49d5 100644--- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs+++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteUserDataRepository.cs@@ -147,7 +147,7 @@ namespace MediaBrowser.Server.Implementations.Sqlitevar 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.Sqlitethrow new ArgumentNullException("key");}- return _userData.GetOrAdd(key, keyName => RetrieveUserData(userId, key));+ return _userData.GetOrAdd(GetInternalKey(userId, key), keyName => RetrieveUserData(userId, key));}/// <summary>