Files
ersatztv/ErsatzTV/Pages/EmbyMediaSources.razor
T
Jason DoveandGitHub c02b83d0d6 code cleanup (#743)
* update tools

* run code cleanup

* update dependencies
2022-04-19 17:47:18 -05:00

31 lines
939 B
Plaintext

@page "/media/sources/emby"
@using ErsatzTV.Core.Interfaces.Emby
@using ErsatzTV.Application.Emby
@using ErsatzTV.Core.Emby
@implements IDisposable
@inject IEmbySecretStore _embySecretStore
@inject ChannelWriter<IEmbyBackgroundServiceRequest> _channel
<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 _channel.WriteAsync(new SynchronizeEmbyLibraries(mediaSourceId), _cts.Token);
}