Initial commit: Jellyfin Black Bar Remover MVP
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using MediaBrowser.Model.Plugins;
|
||||
|
||||
namespace JellyfinPlugin.Configuration
|
||||
{
|
||||
public class PluginConfiguration : BasePluginConfiguration
|
||||
{
|
||||
// Tolerancja detekcji czarnych pasów (domyślnie 0.15 czyli 15%)
|
||||
public double CropDetectLimit { get; set; } = 0.15;
|
||||
|
||||
// Czy wtyczka jest aktywna
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
// Tryb odtwarzania: "Server" (FFmpeg wrapper), "Client" (CSS injection w Web UI), "Both" (Obydwa naraz)
|
||||
public string PlaybackMode { get; set; } = "Both";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<!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>Włącz wykrywanie czarnych pasów</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">Włącza automatyczne skanowanie nowych i zaktualizowanych materiałów wideo w bibliotece.</div>
|
||||
</div>
|
||||
|
||||
<div class="inputContainer">
|
||||
<label class="inputLabel inputLabelUnfocused" for="txtCropLimit">Tolerancja detekcji czarnych pasów (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">Domyślnie 0.15. Zwiększ, jeśli czarne pasy nie są wykrywane ze względu na szum wideo (np. dla plików WEBDL zmień na 0.2).</div>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer">
|
||||
<label class="selectLabel" for="selectPlaybackMode">Sposób usuwania pasów w odtwarzaczu:</label>
|
||||
<select is="emby-select" id="selectPlaybackMode" class="emby-select-withcolor">
|
||||
<option value="Server">Tylko Serwer (Transkodowanie FFmpeg)</option>
|
||||
<option value="Client">Tylko Klient (CSS Clip w Jellyfin Web)</option>
|
||||
<option value="Both">Oba (Transkodowanie lub CSS, zależy od klienta)</option>
|
||||
</select>
|
||||
<div class="fieldDescription">Wybierz, w jaki sposób wtyczka ma usuwać pasy. Opcja serwerowa wymusza transkodowanie (obciążenie CPU/GPU), opcja kliencka jest lżejsza, ale działa tylko w przeglądarce.</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
|
||||
<span>Zapisz</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>
|
||||
Reference in New Issue
Block a user