Include ListOrder on Import (#14854)

This commit is contained in:
JPVenson
2025-09-25 00:22:05 +03:00
committed by GitHub
parent 5a6d9180fe
commit 740b9924a0
2 changed files with 4 additions and 3 deletions

View File

@@ -481,7 +481,7 @@ public sealed class BaseItemRepository
var counts = dbQuery
.GroupBy(x => x.Type)
.Select(x => new { x.Key, Count = x.Count() })
.AsEnumerable();
.ToArray();
var lookup = _itemTypeLookup.BaseItemKindNames;
var result = new ItemCounts();

View File

@@ -319,7 +319,7 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
{
const string personsQuery =
"""
SELECT ItemId, Name, Role, PersonType, SortOrder FROM People
SELECT ItemId, Name, Role, PersonType, SortOrder, ListOrder FROM People
WHERE EXISTS(SELECT 1 FROM TypedBaseItems WHERE TypedBaseItems.guid = People.ItemId)
""";
@@ -347,6 +347,7 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
}
int? sortOrder = reader.IsDBNull(4) ? null : reader.GetInt32(4);
int? listOrder = reader.IsDBNull(5) ? null : reader.GetInt32(5);
personCache.Items.Add(new PeopleBaseItemMap()
{
@@ -354,7 +355,7 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
ItemId = itemId,
People = null!,
PeopleId = personCache.Person.Id,
ListOrder = sortOrder,
ListOrder = listOrder,
SortOrder = sortOrder,
Role = role
});