fix: register the index.html transformation under the shared pattern

File Transformation only runs the callbacks whose pattern string equals
the requested path, so the anchored pattern was skipped whenever another
plugin had registered the plain one. Script chunks that match the pattern
as a regex are returned unchanged.
This commit is contained in:
2026-11-13 22:34:31 +01:00
parent f6083a5839
commit 9c89852e97
3 changed files with 31 additions and 4 deletions
@@ -17,9 +17,11 @@ namespace Jellyfin.Plugin.Herald.Injection;
public class FileTransformationRegistrar : IHostedService
{
private const string InterfaceTypeName = "Jellyfin.Plugin.FileTransformation.PluginInterface";
// File Transformation treats this as a regular expression. Unanchored, "index.html" would also
// match script chunks such as "session-login-index-html.<hash>.chunk.js".
private const string IndexHtmlPattern = @"^index\.html$";
// Has to be the literal "index.html" every other plugin registers. File Transformation groups
// callbacks by pattern string and, for a request, only runs the group whose key equals the path;
// a differently spelled pattern is skipped as soon as another plugin uses the plain one.
// The pattern is also used as a regex and matches some script chunks, which the transformer ignores.
private const string IndexHtmlPattern = "index.html";
private static readonly Guid _transformationId = Guid.Parse("bf6fabc9-721c-46d9-9e13-3cc415a9ae1b");
private readonly ILogger<FileTransformationRegistrar> _logger;