Files
ersatztv/ErsatzTV/Pages/JellyfinMediaSources.razor
T
Jason DoveandGitHub bbd8bc6c7e add button to refresh list of libraries (#226)
* add button to refresh list of libraries

* code cleanup
2021-05-28 15:28:45 -05:00

23 lines
887 B
Plaintext

@page "/media/jellyfin"
@using ErsatzTV.Core.Interfaces.Jellyfin
@using ErsatzTV.Application.Jellyfin.Commands
@using ErsatzTV.Application.Jellyfin.Queries
@inject IJellyfinSecretStore _jellyfinSecretStore
@inject ChannelWriter<IJellyfinBackgroundServiceRequest> _channel
<RemoteMediaSources
TViewModel="ErsatzTV.Application.Jellyfin.JellyfinMediaSourceViewModel"
TSecrets="ErsatzTV.Core.Jellyfin.JellyfinSecrets"
TMediaSource="JellyfinMediaSource"
Name="Jellyfin"
GetAllMediaSourcesCommand="@(new GetAllJellyfinMediaSources())"
DisconnectCommand="@(new DisconnectJellyfin())"
RefreshLibrariesCommand="@(mediaSourceId => RefreshLibraries(mediaSourceId))"
SecretStore="@_jellyfinSecretStore"/>
@code {
private async Task RefreshLibraries(int mediaSourceId) =>
await _channel.WriteAsync(new SynchronizeJellyfinLibraries(mediaSourceId));
}