mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-17 11:43:44 +01:00
moved displaypreferences to usermanager to solve concurrency issues
This commit is contained in:
@@ -124,15 +124,6 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
LazyInitializer.EnsureInitialized(ref _libraryItemsCache, ref _libraryItemsCacheInitialized, ref _libraryItemsCacheSyncLock, CreateLibraryItemsCache);
|
||||
return _libraryItemsCache;
|
||||
}
|
||||
set
|
||||
{
|
||||
_libraryItemsCache = value;
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
_libraryItemsCacheInitialized = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -756,26 +747,6 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
await RootFolder.ValidateChildren(progress, cancellationToken, recursive: true).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves display preferences for a Folder
|
||||
/// </summary>
|
||||
/// <param name="user">The user.</param>
|
||||
/// <param name="folder">The folder.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
/// <returns>Task.</returns>
|
||||
public Task SaveDisplayPreferencesForFolder(User user, Folder folder, DisplayPreferences data)
|
||||
{
|
||||
// Need to update all items with the same DisplayPreferencesId
|
||||
foreach (var child in RootFolder.GetRecursiveChildren(user)
|
||||
.OfType<Folder>()
|
||||
.Where(i => i.DisplayPreferencesId == folder.DisplayPreferencesId))
|
||||
{
|
||||
child.AddOrUpdateDisplayPreferences(user, data);
|
||||
}
|
||||
|
||||
return Kernel.DisplayPreferencesRepository.SaveDisplayPreferences(folder, CancellationToken.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default view.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user