add button to refresh list of libraries (#226)

* add button to refresh list of libraries

* code cleanup
This commit is contained in:
Jason Dove
2021-05-28 15:28:45 -05:00
committed by GitHub
parent e841c9c53b
commit bbd8bc6c7e
11 changed files with 97 additions and 22 deletions
+11 -2
View File
@@ -1,8 +1,9 @@
@page "/media/emby"
@using ErsatzTV.Core.Interfaces.Emby
@using ErsatzTV.Application.Emby.Queries
@using ErsatzTV.Application.Emby.Commands
@using ErsatzTV.Application.Emby.Queries
@inject IEmbySecretStore _embySecretStore
@inject ChannelWriter<IEmbyBackgroundServiceRequest> _channel
<RemoteMediaSources
TViewModel="ErsatzTV.Application.Emby.EmbyMediaSourceViewModel"
@@ -11,4 +12,12 @@
Name="Emby"
GetAllMediaSourcesCommand="@(new GetAllEmbyMediaSources())"
DisconnectCommand="@(new DisconnectEmby())"
SecretStore="@_embySecretStore"/>
RefreshLibrariesCommand="@(mediaSourceId => RefreshLibraries(mediaSourceId))"
SecretStore="@_embySecretStore"/>
@code {
private async Task RefreshLibraries(int mediaSourceId) =>
await _channel.WriteAsync(new SynchronizeEmbyLibraries(mediaSourceId));
}