Stream custom live channels using your own media
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.
 
 
 
 

37 lines
1.6 KiB

@page "/media/sources/emby/{Id:int}/paths"
@using ErsatzTV.Application.Emby
@using ErsatzTV.Application.MediaSources
@inject IMediator Mediator
<RemoteMediaSourcePathReplacementsEditor
Id="@Id"
Name="Emby"
GetMediaSourceById="GetMediaSourceById"
GetUpdatePathReplacementsRequest="GetUpdatePathReplacementsRequest"
GetPathReplacementsBySourceId="GetPathReplacementsBySourceId"/>
@code {
[Parameter]
public int Id { get; set; }
private Task<Option<RemoteMediaSourceViewModel>> GetMediaSourceById(int id, CancellationToken cancellationToken) =>
Mediator.Send(new GetEmbyMediaSourceById(Id), cancellationToken)
.MapT(vm => new RemoteMediaSourceViewModel(vm.Id, vm.Name, vm.Address));
private Task<List<RemoteMediaSourcePathReplacementEditViewModel>> GetPathReplacementsBySourceId(int mediaSourceId, CancellationToken cancellationToken) =>
Mediator.Send(new GetEmbyPathReplacementsBySourceId(Id), cancellationToken)
.Map(list => list.Map(ProjectToEditViewModel).ToList());
private RemoteMediaSourcePathReplacementEditViewModel ProjectToEditViewModel(EmbyPathReplacementViewModel item) =>
new() { Id = item.Id, RemotePath = item.EmbyPath, LocalPath = item.LocalPath };
private IRequest<Either<BaseError, Unit>> GetUpdatePathReplacementsRequest(List<RemoteMediaSourcePathReplacementEditViewModel> pathReplacements)
{
var items = pathReplacements
.Map(item => new EmbyPathReplacementItem(item.Id, item.RemotePath, item.LocalPath))
.ToList();
return new UpdateEmbyPathReplacements(Id, items);
}
}