diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3b1fa5..d413d4a 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 dest: intro-skipper-${{ env.GIT_HASH }}.zip - name: Publish prerelease 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. 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/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."); diff --git a/install/install-dll.bat b/install/install-dll.bat new file mode 100644 index 0000000..45b994d --- /dev/null +++ b/install/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/install/install-dll.sh b/install/install-dll.sh new file mode 100644 index 0000000..dd63a6f --- /dev/null +++ b/install/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 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",