From 2af6dcd889c9252a1d1095894d1a8a4d6d576a63 Mon Sep 17 00:00:00 2001 From: Abandoned Cart Date: Wed, 6 Mar 2024 19:10:57 -0500 Subject: [PATCH 1/5] Add beta test install commands --- .github/workflows/build.yml | 3 ++- scripts/install-dll.bat | 27 +++++++++++++++++++++++++++ scripts/install-dll.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 scripts/install-dll.bat create mode 100755 scripts/install-dll.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3b1fa5..19aeb4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,7 +47,8 @@ jobs: uses: vimtor/action-zip@v1.2 if: github.event_name != 'pull_request' with: - files: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll + files: | + ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll scripts/install-dll.bat scripts/install-dll.sh dest: intro-skipper-${{ env.GIT_HASH }}.zip - name: Publish prerelease diff --git a/scripts/install-dll.bat b/scripts/install-dll.bat new file mode 100644 index 0000000..45b994d --- /dev/null +++ b/scripts/install-dll.bat @@ -0,0 +1,27 @@ +if exist %UserProfile%\AppData\Local\jellyfin\plugins\ ( + FOR /F "eol=| delims=" %%I IN ('DIR "%UserProfile%\AppData\Local\jellyfin\plugins\Intro Skipper*" /B /O-D /TW 2^>nul') DO ( + SET "NewestFile=%UserProfile%\AppData\Local\jellyfin\plugins\%%I" + GOTO FoundFile + ) + ECHO Intro Skipper plugin not found! + GOTO UserInput +) + +if exist %ProgramData%\Jellyfin\Server\plugins\ ( + FOR /F "eol=| delims=" %%I IN ('DIR "%ProgramData%\Jellyfin\Server\plugins\Intro Skipper*" /B /O-D /TW 2^>nul') DO ( + SET "NewestFile=%ProgramData%\Jellyfin\Server\plugins\%%I" + GOTO FoundFile + ) + ECHO Intro Skipper plugin not found! + GOTO UserInput +) + +ECHO Jellyfin plugin directory not found! +GOTO UserInput + +:FoundFile +echo "%NewestFile%" +xcopy /y ConfusedPolarBear.Plugin.IntroSkipper.dll "%NewestFile%" + +:UserInput +@pause diff --git a/scripts/install-dll.sh b/scripts/install-dll.sh new file mode 100755 index 0000000..dd63a6f --- /dev/null +++ b/scripts/install-dll.sh @@ -0,0 +1,27 @@ +if [ "$(uname)" == "Darwin" ]; then + # MacOS + if [ -d ~/.local/share/jellyfin/plugins/ ]; then + plugin=$(ls -d ~/.local/share/jellyfin/plugins/Intro\ Skipper* | sort -r | head -n 1 ) + if [ -z "$plugin" ]; then + echo "Intro Skipper plugin not found!" + exit + fi + cp -f ConfusedPolarBear.Plugin.IntroSkipper*.dll \ + "$plugin/ConfusedPolarBear.Plugin.IntroSkipper.dll" + else + echo "Jellyfin plugin directory not found!" + fi +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + # Linux + if [ -d /var/lib/jellyfin/plugins/ ]; then + plugin=$(ls -d /var/lib/jellyfin/plugins/Intro\ Skipper* | sort -r | head -n 1 ) + if [ -z "$plugin' ]; then + echo "Intro Skipper plugin not found!" + exit + fi + cp -f ConfusedPolarBear.Plugin.IntroSkipper*.dll \ + "$plugin/ConfusedPolarBear.Plugin.IntroSkipper.dll" + else + echo "Jellyfin plugin directory not found!" + fi +fi From b9cad22e3b6a589b569b8f72c7e70b1ea07e48ce Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Thu, 7 Mar 2024 15:41:00 -0500 Subject: [PATCH 2/5] Prevent an unnecessary error log --- .../Configuration/inject.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js index 1e5ed00..1a5fe41 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js @@ -45,12 +45,13 @@ introSkipper.viewShow = function () { introSkipper.d("Ignoring location change"); return; } - introSkipper.d("Adding button CSS and element"); introSkipper.injectCss(); introSkipper.injectButton(); - introSkipper.d("Hooking video timeupdate"); introSkipper.videoPlayer = document.querySelector("video"); - introSkipper.videoPlayer.addEventListener("timeupdate", introSkipper.videoPositionChanged); + if (introSkipper.videoPlayer != null) { + introSkipper.d("Hooking video timeupdate"); + introSkipper.videoPlayer.addEventListener("timeupdate", introSkipper.videoPositionChanged); + } } /** * Injects the CSS used by the skip intro button. From 4b353bc0249c525c80fc070bd673794712d9d0eb Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Thu, 7 Mar 2024 17:08:15 -0500 Subject: [PATCH 3/5] Still check for ffmpeg errors on load --- ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs | 2 ++ .../ScheduledTasks/BaseItemAnalyzerTask.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs index 5fd0b8d..8f1c015 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs @@ -109,6 +109,8 @@ public class Plugin : BasePlugin, IHasWebPages _logger.LogError("Unknown error encountered while adding skip button: {Error}", ex); } } + + FFmpegWrapper.CheckFFmpegVersion(); } /// diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs index cc7cf17..82c2cfc 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs @@ -53,8 +53,9 @@ public class BaseItemAnalyzerTask IProgress progress, CancellationToken cancellationToken) { + var ffmpegError = FFmpegWrapper.CheckFFmpegVersion(); // Assert that ffmpeg with chromaprint is installed - if (Plugin.Instance!.Configuration.UseChromaprint && !FFmpegWrapper.CheckFFmpegVersion()) + if (Plugin.Instance!.Configuration.UseChromaprint && !ffmpegError) { throw new FingerprintException( "Analysis terminated! Chromaprint is not enabled in the current ffmpeg. If Jellyfin is running natively, install jellyfin-ffmpeg5. If Jellyfin is running in a container, upgrade to version 10.8.0 or newer."); From ee6a9f8455dde499284b7d11160fe3fb3358e236 Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Thu, 7 Mar 2024 21:17:02 -0500 Subject: [PATCH 4/5] Stop including scripts in each build --- .github/workflows/build.yml | 2 +- {scripts => install}/install-dll.bat | 0 {scripts => install}/install-dll.sh | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename {scripts => install}/install-dll.bat (100%) rename {scripts => install}/install-dll.sh (100%) mode change 100755 => 100644 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19aeb4f..d413d4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: if: github.event_name != 'pull_request' with: files: | - ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll scripts/install-dll.bat scripts/install-dll.sh + ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll dest: intro-skipper-${{ env.GIT_HASH }}.zip - name: Publish prerelease diff --git a/scripts/install-dll.bat b/install/install-dll.bat similarity index 100% rename from scripts/install-dll.bat rename to install/install-dll.bat diff --git a/scripts/install-dll.sh b/install/install-dll.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/install-dll.sh rename to install/install-dll.sh From 1d1a8305a590188ce5d9de61cbe882712e703067 Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Thu, 7 Mar 2024 21:24:18 -0500 Subject: [PATCH 5/5] v0.1.16.2 --- .../ConfusedPolarBear.Plugin.IntroSkipper.csproj | 4 ++-- manifest.json | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ConfusedPolarBear.Plugin.IntroSkipper.csproj b/ConfusedPolarBear.Plugin.IntroSkipper/ConfusedPolarBear.Plugin.IntroSkipper.csproj index 86ac372..b7463bf 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ConfusedPolarBear.Plugin.IntroSkipper.csproj +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ConfusedPolarBear.Plugin.IntroSkipper.csproj @@ -2,8 +2,8 @@ net6.0 ConfusedPolarBear.Plugin.IntroSkipper - 0.1.16.1 - 0.1.16.1 + 0.1.16.2 + 0.1.16.2 true true enable diff --git a/manifest.json b/manifest.json index c131344..5e8c41e 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,15 @@ "category": "General", "imageUrl": "https://raw.githubusercontent.com/jumoog/intro-skipper/master/images/logo.png", "versions": [ - { + { + "version": "0.1.16.2", + "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.16.2/intro-skipper-v0.1.16.2.zip", + "checksum": "714e084cb02d159da57216e2ceec3509", + "timestamp": "2024-03-07T21:20:34Z" + }, + { "version": "0.1.16.1", "changelog": "- See the full changelog at [GitHub](https://github.com/jumoog/intro-skipper/blob/master/CHANGELOG.md)\n", "targetAbi": "10.8.4.0",