From 3d3cc2b91c639a82025be0072eb209342108d4c7 Mon Sep 17 00:00:00 2001 From: Jarian Cottingham Date: Sat, 21 Feb 2026 15:41:08 -0600 Subject: [PATCH] Add play button to media rows when items are tagged --- renderer.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/renderer.js b/renderer.js index b65f700..2882900 100644 --- a/renderer.js +++ b/renderer.js @@ -238,6 +238,36 @@ function addTagToEpisode(filePath, tagType) { // Add a data attribute to track that this file is tagged item.setAttribute('data-tagged-' + tagType, 'true'); + + // Add play button to the end of the row + const playButton = document.createElement('button'); + playButton.className = 'play-button'; + playButton.innerHTML = '▶️'; + playButton.title = 'Play file'; + playButton.dataset.filePath = filePath; + + // Style the play button + playButton.style.marginLeft = '10px'; + playButton.style.padding = '5px 10px'; + playButton.style.border = 'none'; + playButton.style.borderRadius = '3px'; + playButton.style.cursor = 'pointer'; + playButton.style.backgroundColor = '#28a745'; + playButton.style.color = 'white'; + playButton.style.fontWeight = 'bold'; + playButton.style.fontSize = '14px'; + + // Add click handler for play button + playButton.addEventListener('click', function(e) { + e.stopPropagation(); + openVideoPreview(filePath); + }); + + // Add the play button to the file item + const fileTags = item.querySelector('.file-tags'); + if (fileTags) { + fileTags.appendChild(playButton); + } } } }); @@ -272,6 +302,12 @@ function untagFile(filePath, tagType) { // Remove the data attribute item.removeAttribute('data-tagged-' + tagType); + + // Remove play button if it exists + const playButton = item.querySelector('.play-button'); + if (playButton) { + playButton.remove(); + } } } });