Fixed Library DB lookup

pull/12798/head
JPVenson 3 months ago
parent 8dbbb3e243
commit fb48d0790f

@ -261,7 +261,12 @@ public sealed class BaseItemRepository(
PrepareFilterQuery(filter);
using var context = dbProvider.CreateDbContext();
var dbQuery = TranslateQuery(context.BaseItems.AsNoTracking(), context, filter);
IQueryable<BaseItemEntity> dbQuery = context.BaseItems.AsNoTracking()
.Include(e => e.TrailerTypes)
.Include(e => e.Provider)
.Include(e => e.Images)
.Include(e => e.LockedFields);
dbQuery = TranslateQuery(dbQuery, context, filter);
if (filter.Limit.HasValue || filter.StartIndex.HasValue)
{
var offset = filter.StartIndex ?? 0;

@ -292,7 +292,7 @@ public class MigrateLibraryDb : IMigrationRoutine
private (UserData? Data, string? LegacyUserDataKey) GetUserData(ImmutableArray<User> users, SqliteDataReader dto)
{
var indexOfUser = dto.GetInt32(1);
var user = users.ElementAtOrDefault(indexOfUser + 1);
var user = users.ElementAtOrDefault(indexOfUser - 1);
if (user is null)
{

Loading…
Cancel
Save