JR-021, JR-022, JR-023: File Transformation is a hard dependency
Deletes the on-disk index.html injection rather than leaving it switched off. Plugin.cs had already stopped calling it, but an unreachable write path with a live signature is the one a later refactor re-enables by accident, and it was still the behaviour the README and the release changelog advertised. Patching index.html on disk is destructive in ways a plugin cannot clean up after: the patch outlives an uninstall, a web-client upgrade discards it silently, and it races any other plugin touching the same file. It is also a second code path, and the one nobody runs is the one that rots. WebClientPatchService is now removal-only. The strip is factored out as RemoveInjection so it is testable without a filesystem. Removal is the one write JR-021 permits -- an earlier JRay did patch the file, and those users must not be left with a stale injection pointing at endpoints that have since changed. It keys on JRay's own marker, so it touches nothing another plugin added. JR-021 is a requirement to *not do* something, which no unit test can demonstrate, so scripts/checks/no-index-injection.sh verifies it by absence. The check was confirmed to fail on a reintroduced Apply() and on reintroduced ReplaceLast injection -- a check that has only ever passed is not evidence. Jellyfin has no plugin dependency mechanism, so nothing installs File Transformation for the user and a log warning alone is one nobody reads. GET /Plugins/JRay/Status/Dependencies reports whether the dependency is satisfied, and the configuration page renders it with the repository URL and what to do with it. Absent the plugin only the overlay is disabled; every other feature works. JR-022 and JR-023 stay In Progress rather than Done: neither has a test that executes, and this repo has no test project yet. TRACES: JR-021, JR-022, JR-023 | PR-004 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,10 +29,16 @@
|
||||
<span>Enable pause overlay</span>
|
||||
</label>
|
||||
<div class="fieldDescription">
|
||||
Injects a small script into the web client that shows on-screen actors
|
||||
when playback is paused. Disabling this removes the injected script.
|
||||
Shows the cast of the current scene when playback is paused. This
|
||||
requires the
|
||||
<a is="emby-linkbutton" class="button-link" href="https://github.com/IAmParadox27/jellyfin-plugin-file-transformation" target="_blank" rel="noopener">File Transformation</a>
|
||||
plugin, which rewrites the web client's index.html as it is served.
|
||||
JRay never modifies index.html on disk, so there is no fallback if
|
||||
that plugin is absent — only the overlay is affected, and every
|
||||
other JRay feature keeps working.
|
||||
</div>
|
||||
</div>
|
||||
<div id="JRayDependencyStatus" class="fieldDescription" style="margin:0 0 1.5em;padding:0.75em 1em;border-radius:0.25em;display:none;"></div>
|
||||
<div>
|
||||
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
|
||||
<span>Save</span>
|
||||
@@ -131,6 +137,32 @@
|
||||
.replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
// ---- Dependency status ----
|
||||
// Jellyfin cannot install a plugin's dependency, so the only thing
|
||||
// that closes the gap is saying so where an admin can act on it.
|
||||
function loadDependencyStatus() {
|
||||
var el = document.querySelector('#JRayDependencyStatus');
|
||||
return jrayApi('Status/Dependencies').then(function (status) {
|
||||
el.style.display = '';
|
||||
if (status.file_transformation_available) {
|
||||
el.style.background = 'rgba(82,168,82,0.15)';
|
||||
el.innerHTML = '<strong>File Transformation detected.</strong> '
|
||||
+ 'The pause overlay is served by rewriting index.html as it is '
|
||||
+ 'sent, leaving the file on disk untouched.';
|
||||
return;
|
||||
}
|
||||
|
||||
el.style.background = 'rgba(220,160,60,0.18)';
|
||||
el.innerHTML = '<strong>File Transformation is not installed — the pause '
|
||||
+ 'overlay is disabled.</strong> Every other JRay feature is unaffected. '
|
||||
+ 'To enable it, add this repository in Dashboard → Plugins → '
|
||||
+ 'Repositories, then install "File Transformation" and restart:<br />'
|
||||
+ '<code>' + escapeHtml(status.file_transformation_manifest_url) + '</code>';
|
||||
}).catch(function () {
|
||||
el.style.display = 'none';
|
||||
});
|
||||
}
|
||||
|
||||
// ---- Coverage ----
|
||||
|
||||
var JRayCoverColors = {
|
||||
@@ -340,6 +372,7 @@
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
loadDependencyStatus();
|
||||
populateValueSelect();
|
||||
loadRules();
|
||||
loadCoverage();
|
||||
|
||||
Reference in New Issue
Block a user