* fix formatting rules * reformat ersatztv * reformat ersatztv.application * reformat ersatztv.core * refactor ersatztv.core.tests * reformat ersatztv.ffmpeg * reformat ersatztv.ffmpeg.tests * reformat ersatztv.infrastructure * cleanup infra mysql * cleanup infra sqlite * cleanup infra tests * cleanup ersatztv.scanner * cleanup ersatztv.scanner.tests * sln cleanup * update dependencies
32 lines
1021 B
Plaintext
32 lines
1021 B
Plaintext
@page "/media/sources/jellyfin"
|
|
@using ErsatzTV.Application.Jellyfin
|
|
@using ErsatzTV.Core.Interfaces.Jellyfin
|
|
@using ErsatzTV.Core.Jellyfin
|
|
@implements IDisposable
|
|
@inject IJellyfinSecretStore JellyfinSecretStore
|
|
@inject ChannelWriter<IScannerBackgroundServiceRequest> ScannerWorkerChannel
|
|
|
|
<RemoteMediaSources
|
|
TViewModel="JellyfinMediaSourceViewModel"
|
|
TSecrets="JellyfinSecrets"
|
|
TMediaSource="JellyfinMediaSource"
|
|
Name="Jellyfin"
|
|
GetAllMediaSourcesCommand="@(new GetAllJellyfinMediaSources())"
|
|
DisconnectCommand="@(new DisconnectJellyfin())"
|
|
RefreshLibrariesCommand="@(mediaSourceId => RefreshLibraries(mediaSourceId))"
|
|
SecretStore="@JellyfinSecretStore"/>
|
|
|
|
@code {
|
|
private readonly CancellationTokenSource _cts = new();
|
|
|
|
public void Dispose()
|
|
{
|
|
_cts.Cancel();
|
|
_cts.Dispose();
|
|
}
|
|
|
|
private async Task RefreshLibraries(int mediaSourceId) =>
|
|
await ScannerWorkerChannel.WriteAsync(new SynchronizeJellyfinLibraries(mediaSourceId), _cts.Token);
|
|
|
|
}
|