mirror of https://github.com/ErsatzTV/ErsatzTV.git
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.
17 lines
594 B
17 lines
594 B
using System.Threading; |
|
using System.Threading.Tasks; |
|
using ErsatzTV.Core.Interfaces.Search; |
|
using LanguageExt; |
|
|
|
namespace ErsatzTV.Application.Search.Commands |
|
{ |
|
public class AddItemsToSearchIndexHandler : MediatR.IRequestHandler<AddItemsToSearchIndex, Unit> |
|
{ |
|
private readonly ISearchIndex _searchIndex; |
|
|
|
public AddItemsToSearchIndexHandler(ISearchIndex searchIndex) => _searchIndex = searchIndex; |
|
|
|
public Task<Unit> Handle(AddItemsToSearchIndex request, CancellationToken cancellationToken) => |
|
_searchIndex.AddItems(request.MediaItems); |
|
} |
|
}
|
|
|