Merge pull request #49 from RepoDevil/master

The pretty UI update
This commit is contained in:
TwistedUmbrellaX 2024-03-02 13:29:25 -05:00 committed by GitHub
commit 1d3afbb980
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 144 additions and 119 deletions

View File

@ -9,6 +9,19 @@
<div id="TemplateConfigPage" data-role="page" class="page type-interior pluginConfigurationPage"
data-require="emby-input,emby-button,emby-select,emby-checkbox">
<div data-role="content">
<style>
summary {
cursor: pointer;
padding: 10px;
width: inherit;
margin: auto;
border: none;
text-align: center;
outline: none;
font-size: 1.0em;
outline: 2px solid rgba(155, 155, 155, 0.5);
}
</style>
<div class="content-primary">
<form id="FingerprintConfigForm">
<fieldset class="verticalSection-extrabottompadding">
@ -55,12 +68,15 @@
<div class="fieldDescription">
If checked, episode fingerprints will be cached to the filesystem
<br />
<strong>WARNING: Disabling cache may result in lengthy detection</strong>
<br />
</div>
</div>
<details id="edl">
<summary>EDL file generation</summary>
<br />
<div class="selectContainer">
<label class="selectLabel" for="EdlAction">EDL Action</label>
<select is="emby-select" id="EdlAction" class="emby-select-withcolor emby-select">
@ -115,6 +131,7 @@
<details id="intro_reqs">
<summary>Modify introduction requirements</summary>
<br />
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="AnalysisPercent">
Percent of audio to analyze
@ -179,6 +196,7 @@
<details id="silence">
<summary>Silence detection options</summary>
<br />
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="SilenceDetectionMaximumNoise">
Noise tolerance
@ -287,6 +305,7 @@
<details>
<summary>User Interface Customization</summary>
<br />
<div class="inputContainer">
<label class="inputLabel" for="SkipButtonIntroText">
Skip intro button text
@ -325,19 +344,23 @@
</button>
</div>
</form>
</div>
<br />
<fieldset class="verticalSection-extrabottompadding">
<legend>Advanced</legend>
<details id="support">
<summary>Support Bundle</summary>
<textarea id="supportBundle" rows="20" cols="75" readonly></textarea>
</details>
<br />
<details id="visualizer">
<summary>Advanced</summary>
<summary>Fingerprint Editor</summary>
<br />
<h3 style="margin:0">Select episodes to manage</h3>
<br />
<select id="troubleshooterShow"></select>
<select id="troubleshooterSeason"></select>
<br />
@ -434,7 +457,8 @@
<span id="intros"></span>
</span>
</details>
<br />
</fieldset>
</div>
</div>
<script src="configurationpage?name=visualizer.js"></script>

View File

@ -85,7 +85,7 @@ public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
var indexPath = Path.Join(applicationPaths.WebPath, "index.html");
try
{
InjectSkipButton(indexPath, Path.Join(introsDirectory, "index-pre-skip-button.html"));
InjectSkipButton(indexPath);
}
catch (Exception ex)
{
@ -328,14 +328,11 @@ public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
/// Inject the skip button script into the web interface.
/// </summary>
/// <param name="indexPath">Full path to index.html.</param>
/// <param name="backupPath">Full path to create a backup of index.html at.</param>
private void InjectSkipButton(string indexPath, string backupPath)
private void InjectSkipButton(string indexPath)
{
// Parts of this code are based off of JellyScrub's script injection code.
// https://github.com/nicknsy/jellyscrub/blob/4ce806f602988a662cfe3cdbaac35ee8046b7ec4/Nick.Plugin.Jellyscrub/JellyscrubPlugin.cs
_logger.LogInformation("Adding skip button to {Path}", indexPath);
_logger.LogDebug("Reading index.html from {Path}", indexPath);
var contents = File.ReadAllText(indexPath);
_logger.LogDebug("Successfully read index.html");
@ -349,10 +346,6 @@ public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
return;
}
// Backup the original version of the web interface
_logger.LogInformation("Backing up index.html to {Backup}", backupPath);
File.WriteAllText(backupPath, contents);
// Inject a link to the script at the end of the <head> section.
// A regex is used here to ensure the replacement is only done once.
_logger.LogDebug("Injecting script tag");
@ -363,6 +356,6 @@ public class Plugin : BasePlugin<PluginConfiguration>, IHasWebPages
_logger.LogDebug("Saving modified file");
File.WriteAllText(indexPath, contents);
_logger.LogInformation("Skip intro button successfully added to web interface");
_logger.LogInformation("Skip intro button successfully added");
}
}

View File

@ -8,6 +8,14 @@
"category": "General",
"imageUrl": "https://raw.githubusercontent.com/jumoog/intro-skipper/master/images/logo.png",
"versions": [
{
"version": "0.1.12.0",
"changelog": "- See the full changelog at [GitHub](https://github.com/jumoog/intro-skipper/blob/master/CHANGELOG.md)\n",
"targetAbi": "10.8.4.0",
"sourceUrl": "https://github.com/jumoog/intro-skipper/releases/download/v0.1.12/intro-skipper-v0.1.12.zip",
"checksum": "5851f2d7036bcd56817f66983a8e1190",
"timestamp": "2024-03-02T13:21:04Z"
},
{
"version": "0.1.11.0",
"changelog": "- See the full changelog at [GitHub](https://github.com/jumoog/intro-skipper/blob/master/CHANGELOG.md)\n",