diff --git a/allstarr/Controllers/JellyfinController.cs b/allstarr/Controllers/JellyfinController.cs index cee10b3..c46c425 100644 --- a/allstarr/Controllers/JellyfinController.cs +++ b/allstarr/Controllers/JellyfinController.cs @@ -1453,6 +1453,38 @@ public class JellyfinController : ControllerBase } _logger.LogInformation("Authentication successful"); + + // Post session capabilities immediately after authentication + // This ensures Jellyfin creates a session that will show up in the dashboard + try + { + _logger.LogInformation("🔧 Posting session capabilities after authentication"); + var capabilities = new + { + PlayableMediaTypes = new[] { "Audio" }, + SupportedCommands = Array.Empty(), + SupportsMediaControl = false, + SupportsPersistentIdentifier = true, + SupportsSync = false + }; + + var capabilitiesJson = JsonSerializer.Serialize(capabilities); + var (capResult, capStatus) = await _proxyService.PostJsonAsync("Sessions/Capabilities/Full", capabilitiesJson, Request.Headers); + + if (capStatus == 204 || capStatus == 200) + { + _logger.LogInformation("✓ Session capabilities posted after auth ({StatusCode})", capStatus); + } + else + { + _logger.LogWarning("⚠ Session capabilities returned {StatusCode} after auth", capStatus); + } + } + catch (Exception ex) + { + _logger.LogWarning(ex, "Failed to post session capabilities after auth, continuing anyway"); + } + return Content(result.RootElement.GetRawText(), "application/json"); } catch (Exception ex)