Hide legacy options to avoid confusion (#389)

* Update configPage.html

* Update configPage.html

* Update configPage.html

* Even more covert

* Persistent to avoid accidental flush

* Imply requiring save

* Allow options on checked

* Mention they're not injected by default

* This just doesn't want to work

* Use id whenever poosible

* Helps to do it at the right time

* Add a restart note to flush

* Too many quirks for this way

* Not hidden anymore

* Looks better after the button
This commit is contained in:
TwistedUmbrellaX 2024-11-21 14:20:53 -05:00 committed by GitHub
parent 6ccf002e51
commit d48ea90190
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 139 additions and 106 deletions

View File

@ -174,6 +174,11 @@ public class PluginConfiguration : BasePluginConfiguration
/// </summary> /// </summary>
public bool SkipButtonWarning { get => WarningManager.HasFlag(PluginWarning.UnableToAddSkipButton); } public bool SkipButtonWarning { get => WarningManager.HasFlag(PluginWarning.UnableToAddSkipButton); }
/// <summary>
/// Gets or sets a value indicating whether plugin options are presented to the user.
/// </summary>
public bool PluginSkip { get; set; }
/// <summary> /// <summary>
/// Gets or sets a value indicating whether introductions should be automatically skipped. /// Gets or sets a value indicating whether introductions should be automatically skipped.
/// </summary> /// </summary>

View File

@ -300,6 +300,16 @@
<p align="center" style="font-size: 0.75em">EDL file generation has been removed. Please use endrl's <a href="https://github.com/endrl/jellyfin-plugin-edl">EDL plugin</a>.</p> <p align="center" style="font-size: 0.75em">EDL file generation has been removed. Please use endrl's <a href="https://github.com/endrl/jellyfin-plugin-edl">EDL plugin</a>.</p>
</fieldset> </fieldset>
<p>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="PluginSkip" type="checkbox" is="emby-checkbox" />
<span>Enable injected server-side skip <b style="color: red;">Restart required!</b></span>
</label>
</div>
</p>
<div id="ServerSkipSettings" style="display: none">
<fieldset class="verticalSection-extrabottompadding"> <fieldset class="verticalSection-extrabottompadding">
<legend>Playback</legend> <legend>Playback</legend>
@ -417,6 +427,7 @@
</div> </div>
</details> </details>
</fieldset> </fieldset>
</div>
<div> <div>
<button is="emby-button" type="submit" class="raised button-submit block emby-button"> <button is="emby-button" type="submit" class="raised button-submit block emby-button">
@ -782,7 +793,7 @@
"AutoSkipNotificationText", "AutoSkipNotificationText",
]; ];
var booleanConfigurationFields = ["AutoDetectIntros", "AnalyzeMovies", "AnalyzeSeasonZero", "SelectAllLibraries", "UpdateMediaSegments", "RebuildMediaSegments", "ScanIntroduction", "ScanCredits", "ScanRecap", "ScanPreview", "CacheFingerprints", "AutoSkip", "SkipFirstEpisode", "PersistSkipButton", "SkipButtonEnabled"]; var booleanConfigurationFields = ["AutoDetectIntros", "AnalyzeMovies", "AnalyzeSeasonZero", "SelectAllLibraries", "UpdateMediaSegments", "RebuildMediaSegments", "ScanIntroduction", "ScanCredits", "ScanRecap", "ScanPreview", "CacheFingerprints", "PluginSkip", "AutoSkip", "SkipFirstEpisode", "PersistSkipButton", "SkipButtonEnabled"];
// visualizer elements // visualizer elements
var analyzerActionsSection = document.querySelector("div#analyzerActionsSection"); var analyzerActionsSection = document.querySelector("div#analyzerActionsSection");
@ -814,14 +825,16 @@
var windowHashInterval = 0; var windowHashInterval = 0;
var analyzeMovies = document.getElementById("AnalyzeMovies"); var analyzeMovies = document.getElementById("AnalyzeMovies");
var autoSkip = document.querySelector("input#AutoSkip"); var pluginSkip = document.getElementById("PluginSkip");
var serverSkipSettings = document.getElementById("ServerSkipSettings");
var autoSkip = document.getElementById("AutoSkip");
var skipButtonVisible = document.getElementById("SkipButtonEnabled"); var skipButtonVisible = document.getElementById("SkipButtonEnabled");
var skipButtonVisibleLabel = document.getElementById("SkipButtonVisibleLabel"); var skipButtonVisibleLabel = document.getElementById("SkipButtonVisibleLabel");
var skipButtonSettings = document.getElementById("SkipButtonSettings"); var skipButtonSettings = document.getElementById("SkipButtonSettings");
var selectAllLibraries = document.querySelector("input#SelectAllLibraries"); var selectAllLibraries = document.querySelector("input#SelectAllLibraries");
var librariesContainer = document.querySelector("div.folderAccessListContainer"); var librariesContainer = document.querySelector("div.folderAccessListContainer");
var skipFirstEpisode = document.querySelector("div#divSkipFirstEpisode"); var skipFirstEpisode = document.getElementById("divSkipFirstEpisode");
var secondsOfIntroStartToPlay = document.querySelector("div#divSecondsOfIntroStartToPlay"); var secondsOfIntroStartToPlay = document.getElementById("divSecondsOfIntroStartToPlay");
var autoSkipClientList = document.querySelector("div.AutoSkipClientListContainer"); var autoSkipClientList = document.querySelector("div.AutoSkipClientListContainer");
var movieCreditsDuration = document.getElementById("movieCreditsDuration"); var movieCreditsDuration = document.getElementById("movieCreditsDuration");
@ -906,7 +919,7 @@
generateCheckboxList(libraryNames, "libraryCheckboxes", "SelectedLibraries"); generateCheckboxList(libraryNames, "libraryCheckboxes", "SelectedLibraries");
} }
var persistSkip = document.querySelector("input#PersistSkipButton"); var persistSkip = document.getElementById("PersistSkipButton");
var showAdjustment = document.querySelector("div#divShowPromptAdjustment"); var showAdjustment = document.querySelector("div#divShowPromptAdjustment");
var hideAdjustment = document.querySelector("div#divHidePromptAdjustment"); var hideAdjustment = document.querySelector("div#divHidePromptAdjustment");
@ -923,6 +936,20 @@
persistSkip.addEventListener("change", persistSkipChanged); persistSkip.addEventListener("change", persistSkipChanged);
async function pluginSkipSettingChanged() {
if (pluginSkip.checked) {
serverSkipSettings.style.display = "unset";
} else {
serverSkipSettings.style.display = "none";
// TODO: Reset everything to default
autoSkip.checked = false;
skipButtonVisible.checked = false;
persistSkip.checked = false;
}
}
pluginSkip.addEventListener("change", pluginSkipSettingChanged);
async function analyzeMoviesChanged() { async function analyzeMoviesChanged() {
if (analyzeMovies.checked) { if (analyzeMovies.checked) {
movieCreditsDuration.style.display = "unset"; movieCreditsDuration.style.display = "unset";
@ -1423,6 +1450,7 @@
persistSkipChanged(); persistSkipChanged();
generateAutoSkipTypeList(); generateAutoSkipTypeList();
generateAutoSkipClientList(); generateAutoSkipClientList();
pluginSkipSettingChanged();
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });