You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
using MediaBrowser.Controller.Library;
|
|
using MediaBrowser.Model.Library;
|
|
using System;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MediaBrowser.Server.Implementations.Library.Validators
|
|
{
|
|
public class UserViewPostScanTask : ILibraryPostScanTask
|
|
{
|
|
private readonly IUserManager _userManager;
|
|
private readonly IUserViewManager _userViewManager;
|
|
|
|
public UserViewPostScanTask(IUserManager userManager, IUserViewManager userViewManager)
|
|
{
|
|
_userManager = userManager;
|
|
_userViewManager = userViewManager;
|
|
}
|
|
|
|
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
|
{
|
|
foreach (var user in _userManager.Users)
|
|
{
|
|
foreach (var view in await _userViewManager.GetUserViews(new UserViewQuery
|
|
{
|
|
UserId = user.Id.ToString("N")
|
|
|
|
}, cancellationToken).ConfigureAwait(false))
|
|
{
|
|
await view.RefreshMetadata(cancellationToken).ConfigureAwait(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|