diff --git a/CHANGELOG.md b/CHANGELOG.md index 25754d485..3903e962e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix playback of AC3 audio when targeting stereo output and input layout changes mid-stream - Use other video artwork in XMLTV template - Properly update (add or remove) artwork for all local media libraries when files have changed +- Sync plex library name changes ## [26.1.1] - 2026-01-08 ### Fixed diff --git a/ErsatzTV.Infrastructure/Data/Repositories/MediaSourceRepository.cs b/ErsatzTV.Infrastructure/Data/Repositories/MediaSourceRepository.cs index 7903c2bf1..27aa394f4 100644 --- a/ErsatzTV.Infrastructure/Data/Repositories/MediaSourceRepository.cs +++ b/ErsatzTV.Infrastructure/Data/Repositories/MediaSourceRepository.cs @@ -171,8 +171,9 @@ public class MediaSourceRepository(IDbContextFactory dbContextFactory foreach (PlexLibrary incoming in toUpdate) { Option maybeExisting = await dbContext.PlexLibraries + .Where(pl => pl.MediaSourceId == plexMediaSourceId) .Include(l => l.Paths) - .SelectOneAsync(l => l.Key, l => l.Key == incoming.Key, cancellationToken); + .SingleOrDefaultAsync(l => l.Key == incoming.Key, cancellationToken); foreach (PlexLibrary existingLibrary in maybeExisting) { @@ -201,6 +202,8 @@ public class MediaSourceRepository(IDbContextFactory dbContextFactory existing.Path = path.Path; } } + + existingLibrary.Name = incoming.Name; } }