Merge pull request #47 from RepoDevil/master

[WIP] Expanding user configuration
This commit is contained in:
TwistedUmbrellaX 2024-03-01 15:20:46 -05:00 committed by GitHub
commit 8eca5ee61d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 62 additions and 4 deletions

View File

@ -6,6 +6,9 @@ on:
pull_request: pull_request:
branches: [ "master" ] branches: [ "master" ]
permissions:
contents: write
jobs: jobs:
build: build:
@ -25,6 +28,11 @@ jobs:
- name: Embed version info - name: Embed version info
run: echo "${{ github.sha }}" > ConfusedPolarBear.Plugin.IntroSkipper/Configuration/version.txt run: echo "${{ github.sha }}" > ConfusedPolarBear.Plugin.IntroSkipper/Configuration/version.txt
- name: Retrieve commit identification
run: |
GIT_HASH=$(git rev-parse --short HEAD)
echo "GIT_HASH=${GIT_HASH}" >> $GITHUB_ENV
- name: Build - name: Build
run: dotnet build --no-restore run: dotnet build --no-restore
@ -34,3 +42,20 @@ jobs:
name: intro-skipper-${{ github.sha }}.dll name: intro-skipper-${{ github.sha }}.dll
path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
if-no-files-found: error if-no-files-found: error
- name: Create archive
uses: vimtor/action-zip@v1.1
with:
files: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
dest: intro-skipper-${{ env.GIT_HASH }}.zip
- name: Publish prerelease
uses: 8bitDream/action-github-releases@v1.0.0
if: github.event_name != 'pull_request'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: preview
prerelease: true
title: intro-skipper-${{ env.GIT_HASH }}
files: |
intro-skipper-${{ env.GIT_HASH }}.zip

View File

@ -180,5 +180,5 @@ public class PluginConfiguration : BasePluginConfiguration
/// <summary> /// <summary>
/// Gets or sets the notification text sent after automatically skipping an introduction. /// Gets or sets the notification text sent after automatically skipping an introduction.
/// </summary> /// </summary>
public string AutoSkipNotificationText { get; set; } = "Automatically skipped intro"; public string AutoSkipNotificationText { get; set; } = "Intro skipped";
} }

View File

@ -46,6 +46,18 @@
</div> </div>
</div> </div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="CacheFingerprints" type="checkbox" is="emby-checkbox" />
<span>Cache episode fingerprints</span>
</label>
<div class="fieldDescription">
If checked, episode fingerprints will be cached to the filesystem
<br />
</div>
</div>
<details id="edl"> <details id="edl">
<summary>EDL file generation</summary> <summary>EDL file generation</summary>
@ -234,7 +246,7 @@
<div class="checkboxContainer checkboxContainer-withDescription"> <div class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label"> <label class="emby-checkbox-label">
<input id="PersistSkipButton" type="checkbox" is="emby-checkbox" /> <input id="PersistSkipButton" type="checkbox" is="emby-checkbox" />
<span>Display skip through entire intro</span> <span>Display button for intro duration</span>
</label> </label>
<div class="fieldDescription"> <div class="fieldDescription">
@ -311,7 +323,6 @@
<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">
<span>Save</span> <span>Save</span>
</button> </button>
<br />
</div> </div>
</form> </form>
</div> </div>
@ -321,6 +332,7 @@
<textarea id="supportBundle" rows="20" cols="75" readonly></textarea> <textarea id="supportBundle" rows="20" cols="75" readonly></textarea>
</details> </details>
<br />
<details id="visualizer"> <details id="visualizer">
<summary>Advanced</summary> <summary>Advanced</summary>
@ -422,6 +434,7 @@
<span id="intros"></span> <span id="intros"></span>
</span> </span>
</details> </details>
<br />
</div> </div>
<script src="configurationpage?name=visualizer.js"></script> <script src="configurationpage?name=visualizer.js"></script>
@ -469,11 +482,12 @@
var booleanConfigurationFields = [ var booleanConfigurationFields = [
"AnalyzeSeasonZero", "AnalyzeSeasonZero",
"CacheFingerprints",
"RegenerateEdlFiles", "RegenerateEdlFiles",
"AutoSkip", "AutoSkip",
"SkipFirstEpisode", "SkipFirstEpisode",
"SkipButtonVisible",
"PersistSkipButton", "PersistSkipButton",
"SkipButtonVisible"
] ]
// visualizer elements // visualizer elements
@ -490,6 +504,23 @@
var windowHashInterval = 0; var windowHashInterval = 0;
var persistSkip = document.querySelector("input#PersistSkipButton");
var showAdjustment = document.querySelector("input#ShowPromptAdjustment");
var hideAdjustment = document.querySelector("input#HidePromptAdjustment");
// prevent setting unavailable options
async function persistSkipChanged() {
if (persistSkip.checked) {
showAdjustment.style.display = 'none';
hideAdjustment.style.display = 'none';
} else {
showAdjustment.style.display = 'block';
hideAdjustment.style.display = 'block';
}
}
persistSkip.addEventListener("change", persistSkipChanged);
// when the fingerprint visualizer opens, populate show names // when the fingerprint visualizer opens, populate show names
async function visualizerToggled() { async function visualizerToggled() {
if (!visualizer.open) { if (!visualizer.open) {
@ -768,6 +799,8 @@
document.querySelector("#" + field).checked = config[field]; document.querySelector("#" + field).checked = config[field];
} }
persistSkipChanged();
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
}); });
}); });