* properly scope jellyfin disconnect * add emby entities * add emby media source page * add emby media source editor * sync emby libraries * enable emby library sync toggle * add emby path replacements editor * add emby movie synchronization * fix emby artwork * sync emby television * code cleanup * add jellyfin/emby address placeholder * tweak jellyfin/emby address form
27 lines
966 B
C#
27 lines
966 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using ErsatzTV.Core.Interfaces.Repositories;
|
|
using LanguageExt;
|
|
using MediatR;
|
|
using static ErsatzTV.Application.Emby.Mapper;
|
|
|
|
namespace ErsatzTV.Application.Emby.Queries
|
|
{
|
|
public class
|
|
GetEmbyLibrariesBySourceIdHandler : IRequestHandler<GetEmbyLibrariesBySourceId, List<EmbyLibraryViewModel>>
|
|
{
|
|
private readonly IMediaSourceRepository _mediaSourceRepository;
|
|
|
|
public GetEmbyLibrariesBySourceIdHandler(IMediaSourceRepository mediaSourceRepository) =>
|
|
_mediaSourceRepository = mediaSourceRepository;
|
|
|
|
public Task<List<EmbyLibraryViewModel>> Handle(
|
|
GetEmbyLibrariesBySourceId request,
|
|
CancellationToken cancellationToken) =>
|
|
_mediaSourceRepository.GetEmbyLibraries(request.EmbyMediaSourceId)
|
|
.Map(list => list.Map(ProjectToViewModel).ToList());
|
|
}
|
|
}
|