diff options
| author | Patrick Barron <barronpm@gmail.com> | 2023-01-16 11:49:59 -0500 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2023-01-16 11:49:59 -0500 |
| commit | f07553abdf9c3b1462a94de154ec0072cdbf686a (patch) | |
| tree | 75ff78313c3afb47b7c884ee776a610c9ce003ec /Jellyfin.Server.Implementations/Users | |
| parent | ab6baf6486601b6693e98339e2a41646196f0e76 (diff) | |
Optimize EF Core queries and remove unnecessary AsQueryable calls
Diffstat (limited to 'Jellyfin.Server.Implementations/Users')
| -rw-r--r-- | Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs | 3 | ||||
| -rw-r--r-- | Jellyfin.Server.Implementations/Users/UserManager.cs | 1 |
2 files changed, 0 insertions, 4 deletions
diff --git a/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs b/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs index fddad1c4f..8936f57c6 100644 --- a/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs +++ b/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs @@ -62,7 +62,6 @@ namespace Jellyfin.Server.Implementations.Users public IList<ItemDisplayPreferences> ListItemDisplayPreferences(Guid userId, string client) { return _dbContext.ItemDisplayPreferences - .AsQueryable() .Where(prefs => prefs.UserId.Equals(userId) && !prefs.ItemId.Equals(default) && string.Equals(prefs.Client, client)) .ToList(); } @@ -71,7 +70,6 @@ namespace Jellyfin.Server.Implementations.Users public Dictionary<string, string?> ListCustomItemDisplayPreferences(Guid userId, Guid itemId, string client) { return _dbContext.CustomItemDisplayPreferences - .AsQueryable() .Where(prefs => prefs.UserId.Equals(userId) && prefs.ItemId.Equals(itemId) && string.Equals(prefs.Client, client)) @@ -82,7 +80,6 @@ namespace Jellyfin.Server.Implementations.Users public void SetCustomItemDisplayPreferences(Guid userId, Guid itemId, string client, Dictionary<string, string?> customPreferences) { var existingPrefs = _dbContext.CustomItemDisplayPreferences - .AsQueryable() .Where(prefs => prefs.UserId.Equals(userId) && prefs.ItemId.Equals(itemId) && string.Equals(prefs.Client, client)); diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index 19ac007b9..5f9814ed3 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -143,7 +143,6 @@ namespace Jellyfin.Server.Implementations.Users await using (dbContext.ConfigureAwait(false)) { if (await dbContext.Users - .AsQueryable() .AnyAsync(u => u.Username == newName && !u.Id.Equals(user.Id)) .ConfigureAwait(false)) { |
