diff --git a/renderer.js b/renderer.js index 6b6925e..18b70a5 100644 --- a/renderer.js +++ b/renderer.js @@ -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); }); }