github IAmParadox27/jellyfin-plugin-file-transformation 3.0.0.0

6 hours ago

🚀 A New Foundation for File Transformation

File Transformation 3.0.0.0 is a major overhaul of how the plugin integrates with Jellyfin. The transformation system has been rebuilt around standard ASP.NET Core middleware, removing much of the version-specific runtime patching that File Transformation previously relied on.

Alongside Jellyfin 12 support, this release drops support for Jellyfin 10.10.7 and lays a much more maintainable foundation for future Jellyfin releases.

🙌 Huge thanks to @4eh5xitv6787h645ebv

A massive part of this release is thanks to @4eh5xitv6787h645ebv, who took on the major overhaul of File Transformation's core architecture in PR #58.

The move away from the old Harmony/MonoMod-based interception system to standard ASP.NET Core middleware is a significant piece of work. It not only makes File Transformation substantially easier to maintain, but also resolves an entire class of compatibility problems that caused the plugin to malfunction or be disabled on certain Jellyfin versions and platforms (#20, #35, #62, #64, #70, #71).

This is far more than a small patch or isolated feature - it fundamentally improves the foundation the plugin is built on. A huge thank you for the time and effort that went into it.

✨ New Features

  • Added support for Jellyfin 12 and the newer Jellyfin server architecture (#34).
  • Replaced the previous Harmony/MonoMod-based web interception system with standard ASP.NET Core IStartupFilter middleware (PR #58, @4eh5xitv6787h645ebv).
  • Added support for unregistering transformations through PluginInterface.RemoveTransformation(Guid), allowing dependent plugins to cleanly remove transformations when required.
  • Added support for synthesising virtual files for registered transformation paths, restoring support for plugins such as Plugin Pages where the underlying file doesn't physically exist.
  • Added ETag generation and 304 Not Modified support for transformed content.
  • Added Brotli and gzip recompression of transformed responses for remote clients.
  • Added automatic MIME type detection for virtual transformed files.

🛠️ Improvements

  • Removed platform-specific DLL extraction and version-specific Jellyfin shims.
  • Removed dependencies on Harmony, MonoMod and Prometheus from the core transformation pipeline.
  • Improved compatibility across Jellyfin versions and platforms by moving the transformation system onto standard ASP.NET Core APIs (#20, #35, #62, #64).
  • Added per-transformation error isolation so a failure in one plugin's transformation won't prevent other transformations from running.
  • Made transformation registration, removal and execution thread-safe.
  • Added regex caching and timeout protection for transformation matching.
  • Improved handling of Accept-Encoding, including proper quality-value (q) parsing.
  • Improved LAN detection for IPv6-mapped IPv4 addresses.
  • Improved proxy caching behaviour by correctly setting Vary: Accept-Encoding.
  • Reworked HTTP handling to use a shared HttpClient with appropriate timeouts.
  • Hardened named-pipe transformations with timeouts, size limits, EOF handling and improved resource cleanup.

🪲 Bug Fixes

  • Fixed a class of failures where Harmony/MonoMod runtime patching could cause File Transformation to malfunction or be automatically disabled on startup (#20, #35, #62, #64, #71).
  • Fixed #70 where transformations could attempt to use a disposed IServiceProvider after Jellyfin restarted, resulting in 500 responses across the web UI.
  • Fixed transformed content potentially retaining stale trailing bytes when a transformation produced a shorter result than the original response.
  • Fixed failures in one transformation potentially breaking the entire transformation pipeline.
  • Fixed potential HttpClient resource leaks.
  • Fixed named-pipe transformations being able to hang indefinitely or loop on zero-byte reads.
  • Fixed incorrect handling of disabled compression encodings such as gzip;q=0.
  • Fixed failed virtual-file transformations returning an empty successful response instead of reverting to the original 404.
  • Improved middleware failure handling so the original response is served if transformation or recompression fails.

💻 Developer Compatibility

The existing PluginInterface.RegisterTransformation API and registration payload remain compatible with previous releases, so plugins using a standard transformation callback should not need to change how they register transformations.

There are, however, some changes to transformation execution that plugin developers should be aware of:

  • Added PluginInterface.RemoveTransformation(Guid), allowing plugins to explicitly unregister a previously registered transformation.
  • Assembly callbacks still receive the same payload and are expected to return the transformed content as a string.
  • Invalid or failed assembly callbacks now fail safely rather than falling through to another configured callback mechanism. Plugins should ensure their callback assembly, class and method names are valid.
  • HTTP transformation callbacks must now return a successful HTTP status code. Non-success responses are treated as a failed transformation rather than using the response body as transformed content.
  • HTTP callbacks now have a 15 second timeout.
  • Named-pipe callbacks now have connection/error handling and a 50 MB maximum response size.
  • Failed transformations now leave the original response untouched rather than potentially replacing it with invalid or partial output.

These changes are intended to make transformations significantly safer and more predictable, but plugins relying on the previous fallback or error behaviour should review their integrations when updating.

⚠️ Compatibility

  • Jellyfin 10.10.7 is no longer supported.
  • Added support for Jellyfin 12 and its newer server architecture (#34).
  • Users remaining on Jellyfin 10.10.7 will need to stay on an earlier File Transformation release until they upgrade Jellyfin.
  • Removed legacy Harmony/MonoMod runtime patching and version-specific Jellyfin shims.
  • File Transformation now relies on standard ASP.NET Core middleware rather than patching Jellyfin internals, providing a much more stable base for future Jellyfin versions.

Contributors

  • 4eh5xitv6787h645ebv

❤️ Support

If you enjoy using my Jellyfin plugins and want to support the time that goes into building, maintaining, and improving them, you can do so on Ko-fi.

Thank you for using the plugins and being part of the community.

Buy Me a Coffee at ko-fi.com

Don't miss a new jellyfin-plugin-file-transformation release

NewReleases is sending notifications on new releases.