Files
blackBarRemover/JellyfinPlugin/Configuration/configPage.html
T

82 lines
4.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Black Bar Remover</title>
</head>
<body>
<div data-role="page" class="page type-interior pluginConfigurationPage" data-require="emby-input,emby-button,emby-select,emby-checkbox">
<div data-role="content">
<div class="content-primary">
<form class="blackBarRemoverConfigForm">
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input type="checkbox" is="emby-checkbox" id="chkEnablePlugin" />
<span>Enable Black Bar Detection</span>
</label>
<div class="fieldDescription checkboxFieldDescription">Enables automatic scanning of new and updated video files in the library.</div>
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="txtCropLimit">Black Bar Detection Tolerance (0.01 - 1.0):</label>
<input type="number" step="0.01" min="0.01" max="1.0" id="txtCropLimit" is="emby-input" required />
<div class="fieldDescription">Default is 0.15. Increase this value if black bars are not being detected due to video noise (e.g., change to 0.20 for WEB-DL).</div>
</div>
<div class="selectContainer">
<label class="selectLabel" for="selectPlaybackMode">Black Bar Removal Method:</label>
<select is="emby-select" id="selectPlaybackMode" class="emby-select-withcolor">
<option value="Server">Server Only (FFmpeg Transcoding)</option>
<option value="Client">Client Only (CSS Clip in Jellyfin Web)</option>
<option value="Both">Both (Transcoding or CSS, depending on client)</option>
</select>
<div class="fieldDescription">Choose how the plugin should remove black bars. Server option forces transcoding (CPU/GPU load), Client option is lightweight but only works in web browsers.</div>
</div>
<div>
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
<span>Save</span>
</button>
</div>
</form>
</div>
</div>
<script type="text/javascript">
var BlackBarRemoverConfig = {
pluginUniqueId: "12345678-1234-1234-1234-1234567890ab"
};
$('.blackBarRemoverConfigForm').on('pageinit', function (event) {
var page = event.target;
page.addEventListener('viewshow', function () {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(BlackBarRemoverConfig.pluginUniqueId).then(function (config) {
$('#chkEnablePlugin', page).prop('checked', config.IsEnabled || false);
$('#txtCropLimit', page).val(config.CropDetectLimit || 0.15);
$('#selectPlaybackMode', page).val(config.PlaybackMode || "Both");
Dashboard.hideLoadingMsg();
});
});
$('.blackBarRemoverConfigForm').on('submit', function (e) {
e.preventDefault();
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(BlackBarRemoverConfig.pluginUniqueId).then(function (config) {
config.IsEnabled = $('#chkEnablePlugin', page).prop('checked');
config.CropDetectLimit = parseFloat($('#txtCropLimit', page).val());
config.PlaybackMode = $('#selectPlaybackMode', page).val();
ApiClient.updatePluginConfiguration(BlackBarRemoverConfig.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result);
});
});
});
});
</script>
</div>
</body>
</html>