Fix missing play button click handler and add debugging

This commit is contained in:
Jarian Cottingham 2026-02-21 15:50:26 -06:00
parent af2814ce2f
commit 3794289de5

View File

@ -146,6 +146,27 @@ function displayFiles(files) {
openVideoPreview(filePath);
});
// Add click handler for play button
const playButton = fileItem.querySelector('.play-button');
playButton.addEventListener('click', function(e) {
e.stopPropagation();
console.log('Play button clicked for file:', file.path);
// First open the video preview
openVideoPreview(file.path);
// Then move the file to the appropriate folder based on tag type
const fileItem = this.closest('.file-item');
const tagType = fileItem.hasAttribute('data-tagged-extra') ? 'extra' :
fileItem.hasAttribute('data-tagged-commentary') ? 'commentary' : null;
console.log('Tag type determined:', tagType);
if (tagType) {
moveTaggedFile(file.path, tagType);
} else {
console.log('No tag type found for file');
}
});
fileListEl.appendChild(fileItem);
});
}