fix mysql playout builds (#2352)
* more cancellation tokens and fixes * so much cancellation token * fix mysql playout builds
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
@page "/media/sources/jellyfin/{Id:int}/paths"
|
||||
@using ErsatzTV.Application.Jellyfin
|
||||
@using ErsatzTV.Application.MediaSources
|
||||
@implements IDisposable
|
||||
@inject IMediator Mediator
|
||||
|
||||
<RemoteMediaSourcePathReplacementsEditor
|
||||
@@ -12,23 +11,15 @@
|
||||
GetPathReplacementsBySourceId="GetPathReplacementsBySourceId"/>
|
||||
|
||||
@code {
|
||||
private readonly CancellationTokenSource _cts = new();
|
||||
|
||||
[Parameter]
|
||||
public int Id { get; set; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_cts.Cancel();
|
||||
_cts.Dispose();
|
||||
}
|
||||
|
||||
private async Task<Option<RemoteMediaSourceViewModel>> GetMediaSourceById(int id) =>
|
||||
await Mediator.Send(new GetJellyfinMediaSourceById(Id), _cts.Token)
|
||||
private async Task<Option<RemoteMediaSourceViewModel>> GetMediaSourceById(int id, CancellationToken cancellationToken) =>
|
||||
await Mediator.Send(new GetJellyfinMediaSourceById(Id), cancellationToken)
|
||||
.MapT(vm => new RemoteMediaSourceViewModel(vm.Id, vm.Name, vm.Address));
|
||||
|
||||
private async Task<List<RemoteMediaSourcePathReplacementEditViewModel>> GetPathReplacementsBySourceId(int mediaSourceId) =>
|
||||
await Mediator.Send(new GetJellyfinPathReplacementsBySourceId(Id), _cts.Token)
|
||||
private async Task<List<RemoteMediaSourcePathReplacementEditViewModel>> GetPathReplacementsBySourceId(int mediaSourceId, CancellationToken cancellationToken) =>
|
||||
await Mediator.Send(new GetJellyfinPathReplacementsBySourceId(Id), cancellationToken)
|
||||
.Map(list => list.Map(ProjectToEditViewModel).ToList());
|
||||
|
||||
private RemoteMediaSourcePathReplacementEditViewModel ProjectToEditViewModel(JellyfinPathReplacementViewModel item) =>
|
||||
|
||||
Reference in New Issue
Block a user