mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
fixed universal
This commit is contained in:
@@ -867,12 +867,34 @@ public class JellyfinController : ControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Universal audio endpoint that redirects to the stream endpoint.
|
/// Universal audio endpoint - handles transcoding, format negotiation, and adaptive streaming.
|
||||||
|
/// This is the primary endpoint used by Jellyfin Web and most clients.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HttpGet("Audio/{itemId}/universal")]
|
[HttpGet("Audio/{itemId}/universal")]
|
||||||
public Task<IActionResult> UniversalAudio(string itemId)
|
[HttpHead("Audio/{itemId}/universal")]
|
||||||
|
public async Task<IActionResult> UniversalAudio(string itemId)
|
||||||
{
|
{
|
||||||
return StreamAudio(itemId);
|
if (string.IsNullOrWhiteSpace(itemId))
|
||||||
|
{
|
||||||
|
return BadRequest(new { error = "Missing item ID" });
|
||||||
|
}
|
||||||
|
|
||||||
|
var (isExternal, provider, externalId) = _localLibraryService.ParseSongId(itemId);
|
||||||
|
|
||||||
|
if (!isExternal)
|
||||||
|
{
|
||||||
|
// For local content, proxy the universal endpoint with all query parameters
|
||||||
|
var fullPath = $"Audio/{itemId}/universal";
|
||||||
|
if (Request.QueryString.HasValue)
|
||||||
|
{
|
||||||
|
fullPath = $"{fullPath}{Request.QueryString.Value}";
|
||||||
|
}
|
||||||
|
|
||||||
|
return await ProxyJellyfinStream(fullPath, itemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// For external content, use simple streaming (no transcoding support yet)
|
||||||
|
return await StreamExternalContent(provider!, externalId!);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user