From 2d53063ce991c04d494b03a96f3dbb5de961a252 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Tue, 21 Oct 2025 19:10:48 -0500 Subject: [PATCH] edit jellyfin and emby connection info (#2556) --- CHANGELOG.md | 1 + .../Emby/Commands/SaveEmbySecretsHandler.cs | 5 ++++ .../Commands/SaveJellyfinSecretsHandler.cs | 5 ++++ ErsatzTV/Pages/EmbyMediaSources.razor | 3 +- ErsatzTV/Pages/JellyfinMediaSources.razor | 3 +- ErsatzTV/Shared/RemoteMediaSources.razor | 29 ++++++++++++++----- 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 839815764..fddc7a5b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add episode thumbnail artwork URL to XMLTV template - By default, poster will be added as image with type "poster" and thumbnail will be added as image with type "still" - Poster will continue to be added as icon by default +- Add buttons to edit Jellyfin and Emby connection information in **Media Sources** > **Jellyfin** and **Media Sources** > **Emby** ### Fixed - Fix NVIDIA startup errors on arm64 diff --git a/ErsatzTV.Application/Emby/Commands/SaveEmbySecretsHandler.cs b/ErsatzTV.Application/Emby/Commands/SaveEmbySecretsHandler.cs index f284c31a7..30adde720 100644 --- a/ErsatzTV.Application/Emby/Commands/SaveEmbySecretsHandler.cs +++ b/ErsatzTV.Application/Emby/Commands/SaveEmbySecretsHandler.cs @@ -3,6 +3,7 @@ using ErsatzTV.Core; using ErsatzTV.Core.Emby; using ErsatzTV.Core.Interfaces.Emby; using ErsatzTV.Core.Interfaces.Repositories; +using Microsoft.Extensions.Caching.Memory; namespace ErsatzTV.Application.Emby; @@ -12,16 +13,19 @@ public class SaveEmbySecretsHandler : IRequestHandler channel) { _embySecretStore = embySecretStore; _embyApiClient = embyApiClient; _mediaSourceRepository = mediaSourceRepository; + _memoryCache = memoryCache; _channel = channel; } @@ -47,6 +51,7 @@ public class SaveEmbySecretsHandler : IRequestHandler channel) { _jellyfinSecretStore = jellyfinSecretStore; _jellyfinApiClient = jellyfinApiClient; _mediaSourceRepository = mediaSourceRepository; + _memoryCache = memoryCache; _channel = channel; } @@ -47,6 +51,7 @@ public class SaveJellyfinSecretsHandler : IRequestHandler + SecretStore="@EmbySecretStore" + CanEdit="true"/> @code { private async Task RefreshLibraries(int mediaSourceId, CancellationToken cancellationToken) => diff --git a/ErsatzTV/Pages/JellyfinMediaSources.razor b/ErsatzTV/Pages/JellyfinMediaSources.razor index 21e689fbd..de6393a0d 100644 --- a/ErsatzTV/Pages/JellyfinMediaSources.razor +++ b/ErsatzTV/Pages/JellyfinMediaSources.razor @@ -13,7 +13,8 @@ GetAllMediaSourcesCommand="@(new GetAllJellyfinMediaSources())" DisconnectCommand="@(new DisconnectJellyfin())" RefreshLibrariesCommand="@RefreshLibraries" - SecretStore="@JellyfinSecretStore"/> + SecretStore="@JellyfinSecretStore" + CanEdit="true"/> @code { private async Task RefreshLibraries(int mediaSourceId, CancellationToken cancellationToken) => diff --git a/ErsatzTV/Shared/RemoteMediaSources.razor b/ErsatzTV/Shared/RemoteMediaSources.razor index 205c31353..41543e5a9 100644 --- a/ErsatzTV/Shared/RemoteMediaSources.razor +++ b/ErsatzTV/Shared/RemoteMediaSources.razor @@ -28,14 +28,26 @@ } - @if (_mediaSources.Any() && !_isAuthorized) + @if (_mediaSources.Any()) { - - Fix @Name Connection - + @if (CanEdit) + { + + Edit @Name Connection + + } + else if (!_isAuthorized) + { + + Fix @Name Connection + + } }
@@ -102,6 +114,9 @@ [Parameter] public IRemoteMediaSourceSecretStore SecretStore { get; set; } + [Parameter] + public bool CanEdit { get; set; } + private List _mediaSources = []; private bool _isAuthorized;