fix mysql playout builds (#2352)

* more cancellation tokens and fixes

* so much cancellation token

* fix mysql playout builds
This commit is contained in:
Jason Dove
2025-08-27 18:09:56 +00:00
committed by GitHub
parent 1c07df5bc3
commit 9462156148
103 changed files with 2628 additions and 1666 deletions
@@ -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) =>