diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d4dd11..dadaf09 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [ "master" ] +permissions: + contents: write + jobs: build: @@ -25,6 +28,11 @@ jobs: - name: Embed version info 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 run: dotnet build --no-restore @@ -34,3 +42,20 @@ jobs: name: intro-skipper-${{ github.sha }}.dll path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll 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 diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs index fcbfa63..294f565 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/PluginConfiguration.cs @@ -180,5 +180,5 @@ public class PluginConfiguration : BasePluginConfiguration /// /// Gets or sets the notification text sent after automatically skipping an introduction. /// - public string AutoSkipNotificationText { get; set; } = "Automatically skipped intro"; + public string AutoSkipNotificationText { get; set; } = "Intro skipped"; } diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html index 09f3413..bc6b5f6 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html @@ -46,6 +46,18 @@ +
+ + +
+ If checked, episode fingerprints will be cached to the filesystem +
+
+
+
EDL file generation @@ -234,7 +246,7 @@
@@ -311,7 +323,6 @@ -
@@ -321,6 +332,7 @@
+
Advanced @@ -422,6 +434,7 @@
+
@@ -469,11 +482,12 @@ var booleanConfigurationFields = [ "AnalyzeSeasonZero", + "CacheFingerprints", "RegenerateEdlFiles", "AutoSkip", "SkipFirstEpisode", - "SkipButtonVisible", "PersistSkipButton", + "SkipButtonVisible" ] // visualizer elements @@ -490,6 +504,23 @@ 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 async function visualizerToggled() { if (!visualizer.open) { @@ -768,6 +799,8 @@ document.querySelector("#" + field).checked = config[field]; } + persistSkipChanged(); + Dashboard.hideLoadingMsg(); }); });