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; } }