sync plex library name changes (#2783)
* sync plex library name changes * feedback
This commit is contained in:
@@ -171,8 +171,9 @@ public class MediaSourceRepository(IDbContextFactory<TvContext> dbContextFactory
|
||||
foreach (PlexLibrary incoming in toUpdate)
|
||||
{
|
||||
Option<PlexLibrary> 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<TvContext> dbContextFactory
|
||||
existing.Path = path.Path;
|
||||
}
|
||||
}
|
||||
|
||||
existingLibrary.Name = incoming.Name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user