mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-31 12:58:28 +01:00
Applied review comments
This commit is contained in:
@@ -67,10 +67,16 @@ namespace Emby.Server.Implementations.Data
|
||||
progress.Report(percent * 100);
|
||||
}
|
||||
|
||||
using var context = await _dbProvider.CreateDbContextAsync(cancellationToken).ConfigureAwait(false);
|
||||
using var transaction = await context.Database.BeginTransactionAsync(cancellationToken).ConfigureAwait(false);
|
||||
await context.ItemValues.Where(e => e.BaseItemsMap!.Count == 0).ExecuteDeleteAsync(cancellationToken).ConfigureAwait(false);
|
||||
await transaction.CommitAsync(cancellationToken).ConfigureAwait(false);
|
||||
var context = await _dbProvider.CreateDbContextAsync(cancellationToken).ConfigureAwait(false);
|
||||
await using (context.ConfigureAwait(false))
|
||||
{
|
||||
var transaction = await context.Database.BeginTransactionAsync(cancellationToken).ConfigureAwait(false);
|
||||
await using (transaction.ConfigureAwait(false))
|
||||
{
|
||||
await context.ItemValues.Where(e => e.BaseItemsMap!.Count == 0).ExecuteDeleteAsync(cancellationToken).ConfigureAwait(false);
|
||||
await transaction.CommitAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
progress.Report(100);
|
||||
}
|
||||
|
||||
@@ -146,8 +146,8 @@ namespace Emby.Server.Implementations.Library
|
||||
{
|
||||
ItemId = itemId,
|
||||
CustomDataKey = dto.Key,
|
||||
Item = null!,
|
||||
User = null!,
|
||||
Item = null,
|
||||
User = null,
|
||||
AudioStreamIndex = dto.AudioStreamIndex,
|
||||
IsFavorite = dto.IsFavorite,
|
||||
LastPlayedDate = dto.LastPlayedDate,
|
||||
@@ -181,7 +181,13 @@ namespace Emby.Server.Implementations.Library
|
||||
private UserItemData? GetUserData(User user, Guid itemId, List<string> keys)
|
||||
{
|
||||
var cacheKey = GetCacheKey(user.InternalId, itemId);
|
||||
var data = GetUserDataInternal(user.Id, itemId, keys);
|
||||
|
||||
if (_userData.TryGetValue(cacheKey, out var data))
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
data = GetUserDataInternal(user.Id, itemId, keys);
|
||||
|
||||
if (data is null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user