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