From ff67d0b685cf9207c423c9e2ba579b833b2aa26f Mon Sep 17 00:00:00 2001 From: HighImKevin Date: Thu, 22 Oct 2026 14:56:30 -0400 Subject: [PATCH] Fix the Upcoming and Recently Released Episodes section link --- scripts/sectionHelper.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/sectionHelper.js b/scripts/sectionHelper.js index f2a6dd7..c63adbc 100644 --- a/scripts/sectionHelper.js +++ b/scripts/sectionHelper.js @@ -598,10 +598,21 @@ return `#/tv.html?collectionType=tvshows&tab=4&serverId=${ApiClient.serverId()}`; } - // Check for Jellyfin 12, as this universal Upcoming tab is currently broken in Jellyfin 12 - const isJellyfin12 = await window.KefinTweaks.getJellyfinMajorVersion(); - if (id === 'upcoming' || (id === 'recentlyReleased.episodes' && !isJellyfin12)) { + + if (id === 'upcoming' || id === 'recentlyReleased.episodes') { + const isJellyfin12 = await window.KefinTweaks.getJellyfinMajorVersion(); + + if (isJellyfin12) { + const libraries = await window.dataHelper.getLibraries(); + const tvLibraries = libraries.filter(library => library.CollectionType === 'tvshows'); + if (tvLibraries.length > 1) { + return null; + } + const parentId = tvLibraries[0].Id; + return `#/tv?topParentId=${parentId}&collectionType=tvshows&tab=2&serverId=${ApiClient.serverId()}`; + } + return `#/tv.html?collectionType=tvshows&tab=2&serverId=${ApiClient.serverId()}`; }