From 0a437a5588c305ac0865002298a0b0c918d42203 Mon Sep 17 00:00:00 2001 From: Karol Labus Date: Thu, 17 Sep 2026 16:25:01 +0200 Subject: [PATCH] Add extensive diagnostic logging to ClientScript --- JellyfinPlugin/Api/BlackBarService.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/JellyfinPlugin/Api/BlackBarService.cs b/JellyfinPlugin/Api/BlackBarService.cs index 1d9defb..a5cc838 100644 --- a/JellyfinPlugin/Api/BlackBarService.cs +++ b/JellyfinPlugin/Api/BlackBarService.cs @@ -99,18 +99,27 @@ namespace JellyfinPlugin.Api function checkPlayback() { const video = document.querySelector('video'); if (video && video !== currentVideoElement) { + console.log('Black Bar Remover: Found new video element'); currentVideoElement = video; const match = window.location.href.match(/[?&](id|itemId)=([^&#]+)/i); const itemId = match ? match[2] : null; + console.log('Black Bar Remover: Parsed itemId from URL:', itemId, 'URL was:', window.location.href); + if (itemId) { + console.log('Black Bar Remover: Fetching crop data for item', itemId); fetch('/BlackBarRemover/CropById?itemId=' + itemId) .then(r => r.text()) .then(crop => { + console.log('Black Bar Remover: Received crop data:', crop); if (crop) applyCrop(crop); - }); + }) + .catch(e => console.error('Black Bar Remover: API fetch error:', e)); + } else { + console.log('Black Bar Remover: Could not find itemId in URL to fetch crop data.'); } } else if (!video && currentVideoElement) { + console.log('Black Bar Remover: Video element removed'); currentVideoElement = null; } }