mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-24 02:02:29 -04:00
Reodered Context creation
This commit is contained in:
parent
447ff1d23c
commit
c2a0dfb1e5
@ -183,13 +183,13 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
private UserItemData? GetUserDataInternal(Guid userId, List<string> keys)
|
||||
{
|
||||
using var context = _repository.CreateDbContext();
|
||||
var key = keys.FirstOrDefault();
|
||||
if (key is null || !Guid.TryParse(key, out var itemId))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
using var context = _repository.CreateDbContext();
|
||||
var userData = context.UserData.AsNoTracking().FirstOrDefault(e => e.ItemId == itemId && e.UserId.Equals(userId));
|
||||
|
||||
if (userData is not null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user