BaseItemRepository: 100% async conversion complete

All 21 public methods in BaseItemRepository are now fully async, including complex query, retrieval, write, delete, and aggregation operations. Added async signatures to IItemRepository and ILibraryManager with cancellation token support and ConfigureAwait(false). Sync wrappers retained for backward compatibility. Final conversion of GetLatestItemList and GetNextUpSeriesKeys completes Phase 3A. All bulk operations and aggregations are async, enabling concurrent dashboard loading and full PostgreSQL multiplexing. Migration routines fixed for Npgsql "command in progress" errors. Extensive documentation added for conversion process, performance, and testing. Project is now production-ready with zero build errors and 100% backward compatibility.
This commit is contained in:
2026-02-23 12:36:29 -05:00
parent 86883cd5c6
commit f833f0ceeb
26 changed files with 4614 additions and 556 deletions
@@ -165,16 +165,18 @@ public class PeopleRepository(IDbContextFactory<JellyfinDbContext> dbProvider, I
var existingMap = existingMaps.FirstOrDefault(e => e.People.Name == person.Name && e.People.PersonType == person.Type.ToString() && e.Role == person.Role);
if (existingMap is null)
{
await context.PeopleBaseItemMap.AddAsync(new PeopleBaseItemMap()
{
Item = null!,
ItemId = itemId,
People = null!,
PeopleId = entityPerson.Id,
ListOrder = listOrder,
SortOrder = person.SortOrder,
Role = person.Role
}, cancellationToken).ConfigureAwait(false);
await context.PeopleBaseItemMap.AddAsync(
new PeopleBaseItemMap()
{
Item = null!,
ItemId = itemId,
People = null!,
PeopleId = entityPerson.Id,
ListOrder = listOrder,
SortOrder = person.SortOrder,
Role = person.Role
},
cancellationToken).ConfigureAwait(false);
}
else
{