Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51ab1a4b48 | ||
|
|
5279f3929a | ||
|
|
ac85de2cb8 | ||
|
|
7e25861498 |
+10
-2
@@ -7,13 +7,21 @@
|
||||
"owner": "cat-shark",
|
||||
"category": "General",
|
||||
"versions": [
|
||||
{
|
||||
"version": "0.1.0.1",
|
||||
"targetAbi": "12.0.0.0",
|
||||
"changelog": "Bundle version: `917fde`\n\nFirst plugin build. The web bundle is embedded in the DLL and served from /JFVR/jfvr.js; index.html is rewritten at request time, so nothing is written to the jellyfin-web folder on disk.",
|
||||
"sourceUrl": "https://git.cat-shark.xyz/cat-shark/jellyfin_vr_web_plugin/releases/download/v0.1.0.1/Jellyfin.Plugin.JFVR_12.0.0.0.zip",
|
||||
"checksum": "5BB9DA51A50C5449E7C1D0D6602E8813",
|
||||
"timestamp": "2026-10-17T15:33:14"
|
||||
},
|
||||
{
|
||||
"version": "0.1.0.0",
|
||||
"targetAbi": "12.0.0.0",
|
||||
"changelog": "Bundle version: `917fde`\n\nFirst plugin build. The web bundle is embedded in the DLL and served from /JFVR/jfvr.js; index.html is rewritten at request time, so nothing is written to the jellyfin-web folder on disk.",
|
||||
"sourceUrl": "https://git.cat-shark.xyz/cat-shark/jellyfin_vr_web_plugin/releases/download/v0.1.0.0/Jellyfin.Plugin.JFVR_12.0.0.0.zip",
|
||||
"checksum": "66B0A065AF32A07C7D71DD1B9073EE76",
|
||||
"timestamp": "2026-10-16T00:05:11"
|
||||
"checksum": "F9CC1843F0B9386A9E990669112FF533",
|
||||
"timestamp": "2026-10-17T15:25:41"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -240,6 +240,24 @@ def head_ok(url):
|
||||
return e.code, None
|
||||
|
||||
|
||||
def fetch_md5(url):
|
||||
"""Download the published asset and hash it -- exactly what Jellyfin does.
|
||||
|
||||
This is the check that catches a manifest whose checksum no longer matches the
|
||||
uploaded zip (a real failure mode: the install then dies with
|
||||
"The checksum of the received data doesn't match.").
|
||||
"""
|
||||
h = hashlib.md5()
|
||||
req = urllib.request.Request(url, method="GET")
|
||||
with urllib.request.urlopen(req, timeout=300) as resp:
|
||||
while True:
|
||||
chunk = resp.read(1 << 20)
|
||||
if not chunk:
|
||||
break
|
||||
h.update(chunk)
|
||||
return h.hexdigest().upper()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- steps
|
||||
|
||||
|
||||
@@ -275,11 +293,25 @@ def verify_embedded(dll):
|
||||
|
||||
|
||||
def make_zip(dll, target_abi):
|
||||
"""Package the DLL the way Jellyfin expects: one file, named after the assembly.
|
||||
|
||||
The entry gets a fixed timestamp on purpose. zip stores mtimes, so packaging
|
||||
the same DLL twice would otherwise produce different bytes, a different MD5,
|
||||
and a manifest checksum that no longer matches the already-uploaded asset.
|
||||
"""
|
||||
os.makedirs(OUT_DIR, exist_ok=True)
|
||||
asset = "%s_%s.zip" % (ASSEMBLY, target_abi)
|
||||
path = os.path.join(OUT_DIR, asset)
|
||||
with zipfile.ZipFile(path, "w", zipfile.ZIP_DEFLATED) as zf:
|
||||
zf.write(dll, ASSEMBLY + ".dll")
|
||||
|
||||
info = zipfile.ZipInfo(ASSEMBLY + ".dll", date_time=(1980, 1, 1, 0, 0, 0))
|
||||
info.compress_type = zipfile.ZIP_DEFLATED
|
||||
info.external_attr = 0o644 << 16
|
||||
|
||||
with open(dll, "rb") as fh:
|
||||
payload = fh.read()
|
||||
with zipfile.ZipFile(path, "w") as zf:
|
||||
zf.writestr(info, payload)
|
||||
|
||||
print("packaged %s (%d bytes)" % (path, os.path.getsize(path)))
|
||||
return path, asset
|
||||
|
||||
@@ -383,6 +415,13 @@ def main():
|
||||
if status != 200:
|
||||
sys.exit("the asset is not downloadable -- is the release a draft?")
|
||||
|
||||
# What Jellyfin will do at install time: download it and compare MD5.
|
||||
live = fetch_md5(entry["sourceUrl"])
|
||||
if live != checksum:
|
||||
sys.exit("published asset md5 %s != manifest checksum %s -- install would fail"
|
||||
% (live, checksum))
|
||||
print("asset md5 matches the manifest checksum (%s)" % live)
|
||||
|
||||
if not args.no_push:
|
||||
run(["git", "add", "manifest.json", "plugin/build.yaml"], cwd=HERE)
|
||||
dirty = subprocess.run(
|
||||
|
||||
@@ -38,6 +38,7 @@ public sealed class ScriptInjectionStartupFilter : IStartupFilter
|
||||
private readonly BundleProvider _bundle;
|
||||
private readonly ILogger<ScriptInjectionStartupFilter> _logger;
|
||||
private int _loggedOnce;
|
||||
private int _legacyLoggedOnce;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScriptInjectionStartupFilter"/> class.
|
||||
@@ -158,9 +159,15 @@ public sealed class ScriptInjectionStartupFilter : IStartupFilter
|
||||
|
||||
var rewritten = IndexHtmlRewriter.Rewrite(html, scriptUrl, out var removedLegacy);
|
||||
|
||||
if (removedLegacy)
|
||||
if (removedLegacy && Interlocked.Exchange(ref _legacyLoggedOnce, 1) == 0)
|
||||
{
|
||||
_logger.LogInformation("JFVR: removed the legacy deploy.py <script> tag from index.html.");
|
||||
// Logged once, not per request: the legacy tag lives in the on-disk
|
||||
// index.html, so it is stripped from every single response until the
|
||||
// file itself is cleaned up (deploy.py rollback) or deploy.py is run
|
||||
// again. Per-request logging would just fill the log with the same line.
|
||||
_logger.LogInformation(
|
||||
"JFVR: stripping the legacy deploy.py <script> tag from index.html. "
|
||||
+ "It is still present on disk; run 'python3 deploy.py rollback' to clean it up.");
|
||||
}
|
||||
|
||||
if (IndexHtmlRewriter.IsInjected(html) || rewritten == html)
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
# (InstallationManager.GetAvailablePackages), so one package covers all of 12.x.
|
||||
name: "Jellyfin Web VR"
|
||||
guid: "7d33ef59-f9b0-412b-93bd-5cd5353018de"
|
||||
version: "0.1.0.0"
|
||||
version: "0.1.0.1"
|
||||
targetAbi: "12.0.0.0"
|
||||
framework: "net10.0"
|
||||
overview: "VR180/VR360 playback inside Jellyfin Web for Meta Quest 3."
|
||||
|
||||
Reference in New Issue
Block a user