fix(nav): inject request tab via FT HTTP endpoint
File Transformation reflection callbacks often fail across plugin load contexts; register an anonymous TransformIndexHtml endpoint as the reliable injection path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e260677dab
commit
bfa8115fd0
9 files changed
+79
-31
No files matched your search
@@ -9,6 +9,7 @@ using System.Threading.Tasks;
|
||||
using Jellyfin.Data;
|
||||
using Jellyfin.Database.Implementations.Enums;
|
||||
using Jellyfin.Plugin.Request.Configuration;
|
||||
using Jellyfin.Plugin.Request.Hosting;
|
||||
using Jellyfin.Plugin.Request.Storage;
|
||||
using Jellyfin.Plugin.Request.Tmdb;
|
||||
using MediaBrowser.Controller.Library;
|
||||
@@ -79,6 +80,20 @@ public sealed class RequestController : ControllerBase
|
||||
return EmbeddedFile("Web.requestPage.html", "text/html; charset=utf-8");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// File Transformation endpoint: injects nav-loader.js into jellyfin-web index.html.
|
||||
/// Must stay anonymous because File Transformation calls it without auth.
|
||||
/// </summary>
|
||||
/// <param name="payload">Current file contents.</param>
|
||||
/// <returns>Transformed HTML body.</returns>
|
||||
[HttpPost("TransformIndexHtml")]
|
||||
[AllowAnonymous]
|
||||
public ContentResult TransformIndexHtml([FromBody] IndexHtmlPatchPayload payload)
|
||||
{
|
||||
var html = WebNavInjector.InjectHtml(payload?.Contents ?? string.Empty);
|
||||
return Content(html, "text/html; charset=utf-8");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serves plugin web assets.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user