* wip * start to add jellyfin tables to db * code cleanup * finish adding jellyfin media source * sync jellyfin libraries * display list of jellyfin libraries * toggle jellyfin library sync * edit jellyfin path replacements * noop jellyfin scanners * get jellyfin admin user id on startup * implement jellyfin disconnect * add jellyfin libraries to list; start to query jellyfin library items * code cleanup * start to project jellyfin movies * save new jellyfin movies to db * basic jellyfin movie update * load jellyfin actor artwork * load jellyfin movie poster and fan art * more jellyfin artwork fixes, sync audio streams * jellyfin playback sort of works * skip jellyfin movies that are inaccessible * use ffprobe for jellyfin movie statistics * code cleanup * store jellyfin operating system * more jellyfin movie updates * update jellyfin movie poster and fan art * add jellyfin tv types * sync jellyfin shows * sync jellyfin seasons * sync jellyfin episodes * remove missing jellyfin television items * delete empty jellyfin seasons and shows * fix jellyfin updates * fix indexing jellyfin movie and show languages
28 lines
1018 B
C#
28 lines
1018 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.Jellyfin.Mapper;
|
|
|
|
namespace ErsatzTV.Application.Jellyfin.Queries
|
|
{
|
|
public class
|
|
GetJellyfinLibrariesBySourceIdHandler : IRequestHandler<GetJellyfinLibrariesBySourceId,
|
|
List<JellyfinLibraryViewModel>>
|
|
{
|
|
private readonly IMediaSourceRepository _mediaSourceRepository;
|
|
|
|
public GetJellyfinLibrariesBySourceIdHandler(IMediaSourceRepository mediaSourceRepository) =>
|
|
_mediaSourceRepository = mediaSourceRepository;
|
|
|
|
public Task<List<JellyfinLibraryViewModel>> Handle(
|
|
GetJellyfinLibrariesBySourceId request,
|
|
CancellationToken cancellationToken) =>
|
|
_mediaSourceRepository.GetJellyfinLibraries(request.JellyfinMediaSourceId)
|
|
.Map(list => list.Map(ProjectToViewModel).ToList());
|
|
}
|
|
}
|