From 8cd7ff89931a1d32418c6cd2d70894631445e282 Mon Sep 17 00:00:00 2001 From: Cloud9Developer <32144556+Cloud9Developer@users.noreply.github.com> Date: Thu, 16 May 2024 12:23:35 -0500 Subject: [PATCH] Fixed Skip button not displaying when jellyfin context root/path is set (#165) --- .../Configuration/inject.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js index 06a0498..c857592 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/inject.js @@ -24,7 +24,16 @@ introSkipper.d = function (msg) { if (!path.includes("/PlaybackInfo")) { return response; } introSkipper.d("Retrieving skip segments from URL"); introSkipper.d(path); - let id = path.split("/")[2]; + + // Check for context root and set id accordingly + let path_arr = path.split("/"); + let id = ""; + if (path_arr[1] == "Items") { + id = path_arr[2]; + } else { + id = path_arr[3]; + } + introSkipper.skipSegments = await introSkipper.secureFetch(`Episode/${id}/IntroSkipperSegments`); introSkipper.d("Successfully retrieved skip segments"); introSkipper.d(introSkipper.skipSegments);