Files
ersatztv/ErsatzTV/Pages/EmbyMediaSources.razor
T
Jason DoveandGitHub a87ec2d75d cleanup (#1708)
* fix blazor naming

* code cleanup

* update dependencies
2024-05-06 17:00:52 -05:00

31 lines
964 B
Plaintext

@page "/media/sources/emby"
@using ErsatzTV.Application.Emby
@using ErsatzTV.Core.Emby
@using ErsatzTV.Core.Interfaces.Emby
@implements IDisposable
@inject IEmbySecretStore EmbySecretStore
@inject ChannelWriter<IScannerBackgroundServiceRequest> ScannerWorkerChannel
<RemoteMediaSources
TViewModel="EmbyMediaSourceViewModel"
TSecrets="EmbySecrets"
TMediaSource="EmbyMediaSource"
Name="Emby"
GetAllMediaSourcesCommand="@(new GetAllEmbyMediaSources())"
DisconnectCommand="@(new DisconnectEmby())"
RefreshLibrariesCommand="@(mediaSourceId => RefreshLibraries(mediaSourceId))"
SecretStore="@EmbySecretStore"/>
@code {
private readonly CancellationTokenSource _cts = new();
public void Dispose()
{
_cts.Cancel();
_cts.Dispose();
}
private async Task RefreshLibraries(int mediaSourceId) =>
await ScannerWorkerChannel.WriteAsync(new SynchronizeEmbyLibraries(mediaSourceId), _cts.Token);
}