plugin: ship JFVR as a real Jellyfin plugin (self-hosted catalog)
Replaces the deploy.py approach (which sed-patched index.html inside the
container, and was therefore lost on every jellyfin/jellyfin upgrade) with a
proper plugin installable from a Jellyfin plugin repository.
The web bundle is unchanged: the same src/*.js -> dist/jfvr.js is now embedded
in Jellyfin.Plugin.JFVR.dll and served from /JFVR/jfvr.js with a content-hash
cache key. index.html is rewritten at request time by an IStartupFilter
middleware, so nothing on disk is touched.
Verified before this commit:
- dotnet build: 0 warnings, 0 errors (net10.0, Jellyfin.Controller 12.1.0)
- the DLL embeds dist/jfvr.js byte for byte
- 19/19 checks on the rewrite logic (injection, idempotency, legacy-tag
takeover, no </body> safety, other scripts preserved, URL override)
- manifest.json passes Jellyfin's PackageInfo/VersionInfo expectations
- the packaged zip's MD5 matches the checksum the manifest advertises
Details that were checked against the Jellyfin source rather than assumed:
- a catalog version survives when targetAbi <= serverVersion, so a single
targetAbi 12.0.0.0 package covers all of 12.x (server is 12.1.0)
- Jellyfin writes meta.json itself at install time, so the zip needs only
the DLL
- Jellyfin verifies the MD5 at install time
Also adds pack.py (build -> package -> manifest -> Gitea release) and documents
the plugin route in README/HANDOFF, keeping deploy.py as a fallback.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<RootNamespace>Jellyfin.Plugin.JFVR</RootNamespace>
|
||||
<AssemblyName>Jellyfin.Plugin.JFVR</AssemblyName>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<GenerateDocumentationFile>false</GenerateDocumentationFile>
|
||||
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
|
||||
|
||||
<!-- Overridden by pack.py from plugin/build.yaml (dotnet build -p:Version=...). -->
|
||||
<Version>0.1.0.0</Version>
|
||||
|
||||
<!--
|
||||
Single source of truth for the injected bundle. dist/jfvr.js is produced by
|
||||
build.py from src/*.js; embedding it straight from there (instead of copying
|
||||
it into the project) means the DLL can never ship a stale bundle.
|
||||
-->
|
||||
<JfvrBundlePath>$(MSBuildThisFileDirectory)..\..\dist\jfvr.js</JfvrBundlePath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="JfvrCheckBundle" BeforeTargets="PrepareForBuild">
|
||||
<Error
|
||||
Condition="!Exists('$(JfvrBundlePath)')"
|
||||
Text="dist/jfvr.js is missing. Run 'python3 build.py' first (pack.py does this for you)." />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<!--
|
||||
ExcludeAssets=runtime is required: Jellyfin provides these at runtime, and
|
||||
copying them into the plugin folder prevents the plugin from registering.
|
||||
-->
|
||||
<PackageReference Include="Jellyfin.Controller" Version="12.1.0">
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Jellyfin.Model" Version="12.1.0">
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="$(JfvrBundlePath)" LogicalName="Jellyfin.Plugin.JFVR.Web.jfvr.js" />
|
||||
<EmbeddedResource Include="Configuration\configPage.html" LogicalName="Jellyfin.Plugin.JFVR.Configuration.configPage.html" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user