aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2024-11-13 22:04:03 +0000
committerJPVenson <github@jpb.email>2024-11-13 22:04:03 +0000
commit6b371ba04ff1a68f8c88d55a82890255c3dd5600 (patch)
tree73a6d97703a6b2c44558e3270004166aa99cf32a
parente43e34eab89b1ef074641cee62b9640c2a2f7ff0 (diff)
Fixed storage of Person images
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs9
-rw-r--r--Jellyfin.Server.Implementations/Item/BaseItemRepository.cs12
2 files changed, 8 insertions, 13 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 0a98d5435..99c7a7b33 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -2917,8 +2917,6 @@ namespace Emby.Server.Implementations.Library
private async Task SavePeopleMetadataAsync(IEnumerable<PersonInfo> people, CancellationToken cancellationToken)
{
- List<BaseItem>? personsToSave = null;
-
foreach (var person in people)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -2968,15 +2966,10 @@ namespace Emby.Server.Implementations.Library
if (saveEntity)
{
- (personsToSave ??= new()).Add(personEntity);
+ CreateItems([personEntity], null, CancellationToken.None);
await RunMetadataSavers(personEntity, itemUpdateType).ConfigureAwait(false);
}
}
-
- if (personsToSave is not null)
- {
- CreateItems(personsToSave, null, CancellationToken.None);
- }
}
private void StartScanInBackground()
diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
index b367cb9f7..3d377d0d9 100644
--- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
+++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs
@@ -1339,11 +1339,13 @@ public sealed class BaseItemRepository(
}
using var context = dbProvider.CreateDbContext();
- var item = context.BaseItems
- .Include(e => e.TrailerTypes)
- .Include(e => e.Provider)
- .Include(e => e.Images)
- .Include(e => e.LockedFields).AsNoTracking().AsSingleQuery().FirstOrDefault(e => e.Id == id);
+ var item = PrepareItemQuery(context, new()
+ {
+ DtoOptions = new()
+ {
+ EnableImages = true
+ }
+ }).FirstOrDefault(e => e.Id == id);
if (item is null)
{
return null;