Add extensive diagnostic logging to ClientScript
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user