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.
18 lines
686 B
18 lines
686 B
using System.Threading; |
|
using System.Threading.Tasks; |
|
using ErsatzTV.Core.Interfaces.Repositories; |
|
using MediatR; |
|
|
|
namespace ErsatzTV.Application.Libraries.Queries |
|
{ |
|
public class CountMediaItemsByLibraryPathHandler : IRequestHandler<CountMediaItemsByLibraryPath, int> |
|
{ |
|
private readonly ILibraryRepository _libraryRepository; |
|
|
|
public CountMediaItemsByLibraryPathHandler(ILibraryRepository libraryRepository) => |
|
_libraryRepository = libraryRepository; |
|
|
|
public Task<int> Handle(CountMediaItemsByLibraryPath request, CancellationToken cancellationToken) => |
|
_libraryRepository.CountMediaItemsByPath(request.LibraryPathId); |
|
} |
|
}
|
|
|